JX Application Framework
|
#include <JVector.h>
Public Member Functions | |
JVector (const JSize dimCount, const JFloat fillValue=0.0) | |
JVector (const JSize dimCount, const JFloat values[]) | |
JVector (const JSize dimCount, const JFloat v1, const JFloat v2,...) | |
JVector (const JVector &source) | |
~JVector () | |
JVector & | operator= (const JVector &) |
JVector & | operator+= (const JVector &) |
JVector & | operator-= (const JVector &) |
JVector & | operator*= (const JFloat) |
JVector & | operator/= (const JFloat) |
JVector | operator- () const |
JSize | GetDimensionCount () const |
JFloat | GetElement (const JIndex index) const |
void | SetElement (const JIndex index, const JFloat value) |
void | IncrementElement (const JIndex index, const JFloat delta) |
void | SetAllElements (const JFloat value) |
const JFloat * | GetElements () const |
void | Set (const JFloat values[]) |
void | Set (const JFloat v1,...) |
JFloat | GetMinElement (JIndex *index=nullptr) const |
JFloat | GetMaxElement (JIndex *index=nullptr) const |
JFloat | GetLength () const |
JMatrix | Transpose () const |
void | Normalize () |
JVector | UnitVector () const |
Class to represent a column vector. To get a row vector, use transpose. This class was not designed to be a base class! If you need to override it, be sure to make the destructor virtual.
The third form needs 3 arguments to distinguish it from the first form.
The 3rd form does not promote types, so passing 0 will not work. You must enter 0.0 so it is passed as a JFloat.
JVector::JVector | ( | const JVector & | source | ) |
JVector::~JVector | ( | ) |
|
inline |
|
inline |
JFloat JVector::GetLength | ( | ) | const |
Return our Euclidean length.
Returns the maximum element. If index != nullptr, it contains the index of the element that is returned.
Returns the minimum element. If index != nullptr, it contains the index of the element that is returned.
Adds the given value to the specified element.
|
inline |
JVector JVector::operator- | ( | ) | const |
void JVector::Set | ( | const JFloat | v1, |
... | |||
) |
void JVector::Set | ( | const JFloat | values[] | ) |
The number of elements passed in is assumed to be equal to the vector's size.
void JVector::SetAllElements | ( | const JFloat | value | ) |
JMatrix JVector::Transpose | ( | ) | const |
JVector JVector::UnitVector | ( | ) | const |
Return a unit vector in the same direction as ourselves.