Sponsored Content
Full Discussion: vector c++
Top Forums Programming vector c++ Post 302580971 by Corona688 on Sunday 11th of December 2011 12:32:31 PM
Old 12-11-2011
please post the contents of your header file too.
 

10 More Discussions You Might Find Interesting

1. Programming

Saving a vector to a file

Another C++ question, please do notify me if this forum is C-only! :) I'm having a vector... vector<Person> x; ... with a class I've defined (Person). I have several elements in this vector and I would like to save it to a file (binary (?)). And later on open up this file to retrieve... (1 Reply)
Discussion started by: J.P
1 Replies

2. Programming

Linker error when using vector's

using SUN C++ I have a problem when I do a push_back on a vector. The linker gives me a undefined symbol error on __cxa_end_catch. Any ideas, is there a library to include? Thanks Chris (1 Reply)
Discussion started by: CDurkin
1 Replies

3. Programming

Vector Traversing

Hi i have the following structure struct S { char Mod_num; char val; char chr_nm_cd; } I am reading a 2GB file and inserting into the structure and writing into a vector. I feel like only vector will be a right option. I tried with multimap but it is memory intensive and hence i... (1 Reply)
Discussion started by: dhanamurthy
1 Replies

4. Programming

multidimensional array using c++ vector

Hi! I need to make dynamic multidimensional arrays using the vector class. I found in this page How to dynamically create a two dimensional array? - Microsoft: Visual C++ FAQ - Tek-Tips the way to do it in 2D, and now i'm trying to expand it to 3D but i don't understand how is the operator working,... (0 Replies)
Discussion started by: carl.alv
0 Replies

5. Programming

c++ mutidimentional arrays using vector

Hi! I need to make dynamic multidimensional arrays using the vector class. I found in this page How to dynamically create a two dimensional array? - Microsoft: Visual C++ FAQ - Tek-Tips the way to do it in 2D, and now i'm trying to expand it to 3D but i don't understand how is the operator working,... (1 Reply)
Discussion started by: carl.alv
1 Replies

6. Programming

C++ Map using a Vector as a Value Type?

I modified some code I found on Wikipedia concerning maps to see if it would work before applying it to a project I'm working on that has a similar idea. What I would want is for a user to be able to enter sentences and then be able to distinguish how many times a the person entered a word in a... (4 Replies)
Discussion started by: kcgb20
4 Replies

7. Programming

sort a vector

Hi all, I have a vector,the type of the element within it is list<int>,and i wanna sort this vector.So i implemented a function as a predicate for sort(the STL algorithm).Problem came when i missed the bold part in my code,g++ generated lots of error messages.And after i added the bold... (4 Replies)
Discussion started by: homeboy
4 Replies

8. Programming

Array and Vector

Hi all, from my understanding I understand that I can use array in this manner. struct test { int a; int b; int c; }; test testing; //creating an array with the structer type testing.a=1; testing.b=2; testing.c=3; If I'm not wrong we can use array in this manner,... (12 Replies)
Discussion started by: vinzping
12 Replies

9. Shell Programming and Scripting

Vector normalisation

In AWK For 3 individual vectors of the form: -2.772 -9.341 -2.857 -5.140 -6.597 -1.823 -2.730 -5.615 1.159 I would like to write a script that parses line by line to (i) normalise, (ii) divide by the norm for *each* vector. I.e. sqrt(-2.772^2 + -9.341^2 + -2.857^2)=10.154 ... (4 Replies)
Discussion started by: chrisjorg
4 Replies

10. Programming

Number to bit vector

Is there a function to convert number (unsigned int for this example) to binary? I could not find a simple one thru google. While I was learning bloom filter with the example, I was wondering if anybody can help me to 1) display the real bits vector for the bloomfilter; 2) if dataset is very... (11 Replies)
Discussion started by: yifangt
11 Replies
SbVec4f(3)							       Coin								SbVec4f(3)

NAME
SbVec4f - The SbVec4f class is a 4 dimensional vector with floating point coordinates. This vector class is used by many other classes in Coin. It provides storage for a 3 dimensional homogeneoues vector (with the 4 components usually referred to as <x, y, z, w>) aswell as simple floating point arithmetic operations. SYNOPSIS
#include <Inventor/SbLinear.h> Inherited by SbColor4f. Public Member Functions SbVec4f (void) SbVec4f (const float v[4]) SbVec4f (float x, float y, float z, float w) SbVec4f (const SbVec4d &v) SbVec4f (const SbVec4b &v) SbVec4f (const SbVec4s &v) SbVec4f (const SbVec4i32 &v) SbVec4f & setValue (const float v[4]) SbVec4f & setValue (float x, float y, float z, float w) SbVec4f & setValue (const SbVec4d &v) SbVec4f & setValue (const SbVec4b &v) SbVec4f & setValue (const SbVec4s &v) SbVec4f & setValue (const SbVec4i32 &v) const float * getValue (void) const void getValue (float &x, float &y, float &z, float &w) const float & operator[] (int i) const float & operator[] (int i) const SbBool equals (const SbVec4f &v, float tolerance) const float dot (const SbVec4f &v) const void getReal (SbVec3f &v) const float length (void) const float sqrLength (void) const void negate (void) float normalize (void) SbVec4f & operator*= (float d) SbVec4f & operator/= (float d) SbVec4f & operator+= (const SbVec4f &v) SbVec4f & operator-= (const SbVec4f &v) SbVec4f operator- (void) const void print (FILE *fp) const Protected Attributes float vec [4] Related Functions (Note that these are not member functions.) SbVec4f operator* (const SbVec4f &v, float d) SbVec4f operator* (float d, const SbVec4f &v) SbVec4f operator/ (const SbVec4f &v, float d) SbVec4f operator+ (const SbVec4f &v1, const SbVec4f &v2) SbVec4f operator- (const SbVec4f &v1, const SbVec4f &v2) int operator== (const SbVec4f &v1, const SbVec4f &v2) int operator!= (const SbVec4f &v1, const SbVec4f &v2) Detailed Description The SbVec4f class is a 4 dimensional vector with floating point coordinates. This vector class is used by many other classes in Coin. It provides storage for a 3 dimensional homogeneoues vector (with the 4 components usually referred to as <x, y, z, w>) aswell as simple floating point arithmetic operations. See also: SbVec2s, SbVec2f, SbVec2d, SbVec3s, SbVec3f, SbVec3d, SbVec4d. Constructor &; Destructor Documentation SbVec4f::SbVec4f (void) [inline] The default constructor does nothing. The vector coordinates will be uninitialized until a call the setValue(). SbVec4f::SbVec4f (const floatv[4]) [inline] Constructs an SbVec4f instance with initial values from v. SbVec4f::SbVec4f (floatx, floaty, floatz, floatw) [inline] Constructs an SbVec4f instance with the initial homogeneous vector set to <x,y,z,w>. SbVec4f::SbVec4f (const SbVec4d &v) [inline], [explicit] Constructs an SbVec4f instance from an SbVec4d instance. SbVec4f::SbVec4f (const SbVec4b &v) [inline], [explicit] Constructs an SbVec4f instance from an SbVec4b instance. Since: Coin 2.5 SbVec4f::SbVec4f (const SbVec4s &v) [inline], [explicit] Constructs an SbVec4f instance from an SbVec4s instance. Since: Coin 2.5 SbVec4f::SbVec4f (const SbVec4i32 &v) [inline], [explicit] Constructs an SbVec4f instance from an SbVec4i32 instance. Since: Coin 2.5 Member Function Documentation SbVec4f & SbVec4f::setValue (const floatv[4]) [inline] Set new coordinates for the vector from v. Returns reference to self. See also: getValue(). Reimplemented in SbColor4f. SbVec4f & SbVec4f::setValue (floatx, floaty, floatz, floatw) [inline] Set new coordinates for the vector. Returns reference to self. See also: getValue(). Reimplemented in SbColor4f. SbVec4f & SbVec4f::setValue (const SbVec4d &v) Sets the value from an SbVec4d instance. SbVec4f & SbVec4f::setValue (const SbVec4b &v) Since: Coin 2.5 SbVec4f & SbVec4f::setValue (const SbVec4s &v) Since: Coin 2.5 SbVec4f & SbVec4f::setValue (const SbVec4i32 &v) Since: Coin 2.5 const float * SbVec4f::getValue (void) const [inline] Returns a pointer to an array of four floats containing the x, y, z and w coordinates of the vector. See also: setValue(). Reimplemented in SbColor4f. void SbVec4f::getValue (float &x, float &y, float &z, float &w) const [inline] Returns the x, y, z and w coordinates of the vector. See also: setValue(). float & SbVec4f::operator[] (inti) [inline] Index operator. Returns modifiable x, y, z or w component of vector. See also: getValue() and setValue(). Reimplemented in SbColor4f. const float & SbVec4f::operator[] (inti) const [inline] Index operator. Returns x, y, z or w component of vector. See also: getValue() and setValue(). Reimplemented in SbColor4f. SbBool SbVec4f::equals (const SbVec4f &v, floattolerance) const Compares the vector with v and returns TRUE if the distance between the vectors is smaller or equal to the square root of tolerance. The comparison is done in 4D-space, i.e. the w component of the vector is not used to make x, y and z into Cartesian coordinates first. float SbVec4f::dot (const SbVec4f &v) const [inline] Calculates and returns the result of taking the dot product of this vector and v. void SbVec4f::getReal (SbVec3f &v) const Returns the vector as a Cartesian 3D vector in v. This means that the 3 first components x, y and z will be divided by the fourth, w. float SbVec4f::length (void) const Return the length of the vector in 4D space. float SbVec4f::sqrLength (void) const [inline] Return the square of the length of the vector in 4D space. void SbVec4f::negate (void) [inline] Negate the vector. float SbVec4f::normalize (void) Normalize the vector to unit length. Return value is the original length of the vector before normalization. SbVec4f & SbVec4f::operator*= (floatd) [inline] Multiply components of vector with value d. Returns reference to self. Reimplemented in SbColor4f. SbVec4f & SbVec4f::operator/= (floatd) [inline] Divides components of vector with value d. Returns reference to self. Reimplemented in SbColor4f. SbVec4f & SbVec4f::operator+= (const SbVec4f &v) [inline] Adds this vector and vector v. Returns reference to self. SbVec4f & SbVec4f::operator-= (const SbVec4f &v) [inline] Subtracts vector v from this vector. Returns reference to self. SbVec4f SbVec4f::operator- (void) const [inline] Non-destructive negation operator. Returns a new SbVec4f instance which has all components negated. See also: negate(). void SbVec4f::print (FILE *fp) const Dump the state of this object to the file stream. Only works in debug version of library, method does nothing in an optimized compile. Friends And Related Function Documentation SbVec4f operator* (const SbVec4f &v, floatd) [related] Returns an SbVec4f instance which is the components of vector v multiplied with d. SbVec4f operator* (floatd, const SbVec4f &v) [related] Returns an SbVec4f instance which is the components of vector v multiplied with d. SbVec4f operator/ (const SbVec4f &v, floatd) [related] Returns an SbVec4f instance which is the components of vector v divided on the scalar factor d. SbVec4f operator+ (const SbVec4f &v1, const SbVec4f &v2) [related] Returns an SbVec4f instance which is the sum of vectors v1 and v2. SbVec4f operator- (const SbVec4f &v1, const SbVec4f &v2) [related] Returns an SbVec4f instance which is vector v2 subtracted from vector v1. int operator== (const SbVec4f &v1, const SbVec4f &v2) [related] Returns 1 if v1 and v2 are equal, 0 otherwise. See also: equals(). int operator!= (const SbVec4f &v1, const SbVec4f &v2) [related] Returns 1 if v1 and v2 are not equal, 0 if they are equal. See also: equals(). Author Generated automatically by Doxygen for Coin from the source code. Version 3.1.3 Wed May 23 2012 SbVec4f(3)
All times are GMT -4. The time now is 06:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy