Comments (5)
I started implementing this on fixed size vectors in branch feature-vector-ref. Syntax is v.Ref<__size>(startPosition). See examples of use in:
https://github.com/jhu-cisst/cisst/blob/feature-vector-ref/cisstVector/examples/tutorial/ExampleReferences.h
Output looks like:
AsColMatrix:
0.00000
1.00000
2.00000
3.00000
AsRowMatrix:
0.00000 1.00000 2.00000 3.00000
Ref<2>(1):
1.00000 2.00000
Ref<2>(3) on a vector of 4 elements will throw an out of range exception
Exception received: vctFixedSizeVectorRef SetRef out of range
v4, last 2 elements replaced:
0.00000 1.00000 5.50000 5.50000
v4, first 2 elements replaced:
-1.00000 -1.00000 5.50000 5.50000
All input is welcome. I plan to implement a similar method on dynamic vectors, syntax will be: v.Ref(size, startPosition).
I'll check if we can assign between fixed size and dynamic Ref too so one could do: vFixed4.Ref<2>(0) = vDynamic.Ref(2, 10); // assuming vDynamic.size() large enough.
from cisst.
Looks great. Should the dynamic version also use the same template syntax? Is it possible to have the same syntax for both?
from cisst.
Take a look at example file (link above) for features added for dynamic vectors and assigning back and forth between fixed and dynamic Ref (ed42aa5). Also found by accident the already existing & operator, quite cool, see line 65 in example!
from cisst.
Looks great.
I recommend to use this example (no ambiguity):
vA.Ref(4) = vB.Ref(6, 4); // assign last 4 vB to first 4 elements of vA
instead of :
vA.Ref(5) = vB.Ref(5, 5); // assign second half of vB to first 5 elements
of vA
Marcin
On Fri, Jan 30, 2015 at 6:20 PM, Anton Deguet [email protected]
wrote:
Take a look at example file (link above) for features added for dynamic
vectors and assigning back and forth between fixed and dynamic Ref (
ed42aa5
ed42aa5).
Also found by accident the already existing & operator, quite cool, see
line 65 in example!—
Reply to this email directly or view it on GitHub
#17 (comment).
from cisst.
Added code and example for Ref() on fixed size and dynamic matrices (see 22b2201).
from cisst.
Related Issues (20)
- catkin build fails HOT 2
- Markdown alignment error in SVL wiki HOT 1
- catkin build /usr/bin/ld: cannot find -lReflexxesTypeII under ROS Kinetic HOT 3
- mtsFrm4x4
- Add constructor for vctAxisAngleRotation3() using axis and angle HOT 2
- cisst build fails on feature-cxx-compatibility branch HOT 5
- on branch devel: error thrown in mtsGenericObjectProxy::ConditionalCreate HOT 1
- Should the Data Generator Always be Built? HOT 6
- Problem with disconnecting services
- cisstDataGenerator failed to parse mtsParameterTypes.cdg HOT 4
- Support C++17 ISO Standard
- Fail to build cisst with catkin build and cmake versions >= 3.11 on Ubuntu 16.04 HOT 9
- cisstVector Build Fails WhenUsing ClangCl with MSVC 2019
- catkin_make err HOT 1
- Fail to build cisst-ros with catkin build on Ubuntu 16.04 (cannot find mtsDelayedConnections.h) HOT 3
- cisstNumerical Build Fails in Latest Release HOT 6
- Build cisst_netlib error HOT 5
- ROSToCISST missing matrix functionality (std_msgs::Float64MultiArray ---> vctDoubleVec) HOT 4
- Add `override` keyword for all cisst libraries
- Deprecate polynomial related classes in cisstNumerical
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 cisst.