Comments (3)
Personally, I do not like c++/Eigen's philosophy to default to the efficient version, instead to the safe one:
int i;
std::cout << i << std::endl; // reading uninitialized value
In practice, there are only few cases where this is a performance bottleneck, and we really don't want to initialize the variable i
.
In a perfect world
int i; // initializes to 0
int j [[uninitialized]]; // leaves j uninitialized
I can't change c++ built in types, but I can write libraries in such a way.
Long story short, I'd be okay to add a
static SE3<...> uninitilized();
factory which leaves the element uninitialized, if there is demand for it.
from sophus.
Yeah, what I a mess. I thought this was sort of the reason for the new syntax int j{};
http://en.cppreference.com/w/cpp/language/value_initialization
I guess I was thinking about the situation where you have a std::vector
of SE3d
and want to resize()
vs reserve()/push_back()
. Afaik, you're forced to pass over and initialize all of the memory during the resize
even if you plan on initializing with a loop after if your default constructor fully initializes.
from sophus.
I'd say reserve()/push_back()
is clearly the better approach in general, since you don't have to worry about how expensive the default constructor is for a type Foo.
from sophus.
Related Issues (20)
- SO3 setIdentity() HOT 1
- Syntax Error with VS2019 in several headers HOT 2
- QuaternionProduct in So3.hpp missing SOPHUS_FUNC HOT 1
- SOPHUS_FMT_ARG causes compilization error when SOPHUS_USE_BASIC_LOGGING=ON HOT 2
- leftJacobian implementation cannot echo the formula in given PDF HOT 2
- test_so3, test_se3, test_velocities fail on PowePC HOT 4
- Broken link on landing page README.rst HOT 3
- Compilation Error on Raspberry Pi 4 Buster HOT 2
- Looks like 22.10 and 22.04.1 tags got removed? HOT 3
- How to creating a Sophus::SE3f variable from a Eigen::Matrixf variable? HOT 4
- install erorr issue
- Wrong compiler standard in CMakeLists.txt HOT 1
- Documentation link is broken HOT 2
- SOPHUS_USE_BASIC_LOGGING=ON compilation error
- rotationMatrix() and angles give different results HOT 4
- FMT warning when not found
- CUDA::cublas but the target was not found HOT 1
- Sophus ensure failed in function ..... HOT 1
- Error on building ORB-Slam3 on Debian-12 x86-64 HOT 1
- Sophus ensure calls `abort()` HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sophus.