SAGA API  v9.6
CSG_Vector Class Reference

#include <mat_tools.h>

Public Types

typedef double const * const_iterator
 

Public Member Functions

 CSG_Vector (void)
 
virtual ~CSG_Vector (void)
 
 CSG_Vector (const CSG_Vector &Vector)
 
bool Create (const CSG_Vector &Vector)
 
 CSG_Vector (sLong n, const double *Data=NULL)
 
bool Create (sLong n, const double *Data=NULL)
 
bool Destroy (void)
 
bool Set_Rows (sLong nRows)
 
bool Add_Rows (sLong nRows)
 
bool Del_Rows (sLong nRows)
 
bool Add_Row (double Value=0.)
 
bool Del_Row (sLong Row=-1)
 
sLong Get_Row_Count (void) const
 
sLong Get_Size (void) const
 
size_t Get_uSize (void) const
 
int Get_N (void) const
 
double * Get_Data (void) const
 
double Get_Data (sLong x) const
 
double operator() (sLong x) const
 
double & operator[] (sLong x)
 
double & operator[] (size_t x)
 
double & operator[] (int x)
 
const double & operator[] (sLong x) const
 
const double & operator[] (size_t x) const
 
const double & operator[] (int x) const
 
 operator const double * (void) const
 
CSG_String to_String (int Width=-1, int Precision=-1, bool bScientific=false, const SG_Char *Separator=NULL) const
 
bool from_String (const CSG_String &String)
 
bool is_Null (void) const
 
bool is_Equal (const CSG_Vector &Vector) const
 
bool is_Collinear (const CSG_Vector &Vector) const
 
bool Assign (double Scalar)
 
bool Assign (const CSG_Vector &Vector)
 
bool Add (double Scalar)
 
bool Add (const CSG_Vector &Vector)
 
bool Subtract (const CSG_Vector &Vector)
 
bool Multiply (double Scalar)
 
bool Multiply (const CSG_Vector &Vector)
 
bool Multiply_Cross (const CSG_Vector &Vector)
 
double Multiply_Scalar (const CSG_Vector &Vector) const
 
bool Multiply (const class CSG_Matrix &Matrix)
 
bool operator== (const CSG_Vector &Vector) const
 
bool operator!= (const CSG_Vector &Vector) const
 
CSG_Vectoroperator= (double Scalar)
 
CSG_Vectoroperator= (const CSG_Vector &Vector)
 
CSG_Vectoroperator+= (double Scalar)
 
CSG_Vectoroperator+= (const CSG_Vector &Vector)
 
CSG_Vectoroperator-= (double Scalar)
 
CSG_Vectoroperator-= (const CSG_Vector &Vector)
 
CSG_Vectoroperator*= (double Scalar)
 
CSG_Vectoroperator*= (const CSG_Vector &Vector)
 
CSG_Vectoroperator*= (const class CSG_Matrix &Matrix)
 
CSG_Vector operator+ (double Scalar) const
 
CSG_Vector operator+ (const CSG_Vector &Vector) const
 
CSG_Vector operator- (double Scalar) const
 
CSG_Vector operator- (const CSG_Vector &Vector) const
 
CSG_Vector operator* (double Scalar) const
 
double operator* (const CSG_Vector &Vector) const
 
bool Set_Zero (void)
 
bool Set_Unity (void)
 
bool Flip_Values (void)
 
bool Sort (bool bAscending=true)
 
double Get_Length (void) const
 
CSG_Vector Get_Scalar_Product (const CSG_Vector &Vector) const
 
CSG_Vector Get_Cross_Product (const CSG_Vector &Vector) const
 
double Get_Angle (const CSG_Vector &Vector) const
 
CSG_Vector Get_Unity (void) const
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
const_iterator cbegin (void) const
 
const_iterator cend (void) const
 

Detailed Description

Definition at line 359 of file mat_tools.h.

Member Typedef Documentation

◆ const_iterator

typedef double const* CSG_Vector::const_iterator

Definition at line 444 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Vector() [1/3]

CSG_Vector::CSG_Vector ( void  )

Definition at line 74 of file mat_matrix.cpp.

References CSG_Array::Create().

◆ ~CSG_Vector()

CSG_Vector::~CSG_Vector ( void  )
virtual

Definition at line 125 of file mat_matrix.cpp.

References Destroy().

◆ CSG_Vector() [2/3]

CSG_Vector::CSG_Vector ( const CSG_Vector Vector)

Definition at line 80 of file mat_matrix.cpp.

References CSG_Array::Create(), and Create().

◆ CSG_Vector() [3/3]

CSG_Vector::CSG_Vector ( sLong  n,
const double *  Data = NULL 
)

Definition at line 93 of file mat_matrix.cpp.

References CSG_Array::Create(), and Create().

Member Function Documentation

◆ Add() [1/2]

bool CSG_Vector::Add ( const CSG_Vector Vector)

Definition at line 362 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

◆ Add() [2/2]

bool CSG_Vector::Add ( double  Scalar)

Definition at line 346 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by operator+(), operator+=(), operator-(), and operator-=().

◆ Add_Row()

◆ Add_Rows()

bool CSG_Vector::Add_Rows ( sLong  nRows)

Definition at line 156 of file mat_matrix.cpp.

References Get_Data(), Get_Size(), and CSG_Array::Set_Array().

Referenced by CSG_Trend_Polynom::Set_Data(), and Set_Rows().

◆ Assign() [1/2]

bool CSG_Vector::Assign ( const CSG_Vector Vector)

Definition at line 333 of file mat_matrix.cpp.

References Create(), Get_Data(), and Get_Size().

◆ Assign() [2/2]

bool CSG_Vector::Assign ( double  Scalar)

Definition at line 317 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by Create(), Multiply(), and operator=().

◆ begin()

const_iterator CSG_Vector::begin ( void  ) const
inline

Definition at line 446 of file mat_tools.h.

◆ cbegin()

const_iterator CSG_Vector::cbegin ( void  ) const
inline

Definition at line 448 of file mat_tools.h.

◆ cend()

const_iterator CSG_Vector::cend ( void  ) const
inline

Definition at line 449 of file mat_tools.h.

◆ Create() [1/2]

◆ Create() [2/2]

bool CSG_Vector::Create ( sLong  n,
const double *  Data = NULL 
)

Definition at line 100 of file mat_matrix.cpp.

References Destroy(), Get_Data(), and CSG_Array::Set_Array().

◆ Del_Row()

bool CSG_Vector::Del_Row ( sLong  Row = -1)

Definition at line 201 of file mat_matrix.cpp.

References CSG_Array::Dec_Array(), Get_Data(), and Get_Size().

◆ Del_Rows()

bool CSG_Vector::Del_Rows ( sLong  nRows)

Deletes last nRows rows. Sets size to zero if nRows is greater than current number of rows Returns true if successful.

Definition at line 177 of file mat_matrix.cpp.

References Destroy(), Get_Size(), and CSG_Array::Set_Array().

Referenced by Set_Rows().

◆ Destroy()

◆ end()

const_iterator CSG_Vector::end ( void  ) const
inline

Definition at line 447 of file mat_tools.h.

◆ Flip_Values()

bool CSG_Vector::Flip_Values ( void  )

Definition at line 619 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by Sort().

◆ from_String()

bool CSG_Vector::from_String ( const CSG_String String)

◆ Get_Angle()

double CSG_Vector::Get_Angle ( const CSG_Vector Vector) const

Definition at line 703 of file mat_matrix.cpp.

References A, B, Get_Angle(), Get_Data(), Get_Length(), and Get_Size().

Referenced by Get_Angle().

◆ Get_Cross_Product()

CSG_Vector CSG_Vector::Get_Cross_Product ( const CSG_Vector Vector) const

Definition at line 675 of file mat_matrix.cpp.

References Multiply_Cross().

◆ Get_Data() [1/2]

double CSG_Vector::Get_Data ( sLong  x) const
inline

Definition at line 385 of file mat_tools.h.

References Get_Data().

Referenced by Get_Data().

◆ Get_Data() [2/2]

◆ Get_Length()

double CSG_Vector::Get_Length ( void  ) const

Definition at line 685 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by Get_Angle(), is_Collinear(), and Set_Unity().

◆ Get_N()

◆ Get_Row_Count()

sLong CSG_Vector::Get_Row_Count ( void  ) const
inline

Definition at line 379 of file mat_tools.h.

◆ Get_Scalar_Product()

CSG_Vector CSG_Vector::Get_Scalar_Product ( const CSG_Vector Vector) const

Definition at line 665 of file mat_matrix.cpp.

References Multiply_Scalar().

◆ Get_Size()

◆ Get_Unity()

CSG_Vector CSG_Vector::Get_Unity ( void  ) const

Definition at line 733 of file mat_matrix.cpp.

References Set_Unity().

◆ Get_uSize()

size_t CSG_Vector::Get_uSize ( void  ) const
inline

Definition at line 381 of file mat_tools.h.

◆ is_Collinear()

bool CSG_Vector::is_Collinear ( const CSG_Vector Vector) const

Definition at line 296 of file mat_matrix.cpp.

References Get_Data(), Get_Length(), Get_N(), Get_Size(), and is_Null().

◆ is_Equal()

bool CSG_Vector::is_Equal ( const CSG_Vector Vector) const

Definition at line 277 of file mat_matrix.cpp.

References Get_Data(), Get_N(), and Get_Size().

◆ is_Null()

bool CSG_Vector::is_Null ( void  ) const

Definition at line 263 of file mat_matrix.cpp.

References Get_Data(), and Get_N().

Referenced by is_Collinear().

◆ Multiply() [1/3]

bool CSG_Vector::Multiply ( const class CSG_Matrix Matrix)

Definition at line 449 of file mat_matrix.cpp.

References Assign(), and CSG_Matrix::Multiply().

◆ Multiply() [2/3]

bool CSG_Vector::Multiply ( const CSG_Vector Vector)

Definition at line 410 of file mat_matrix.cpp.

References Multiply_Cross().

◆ Multiply() [3/3]

bool CSG_Vector::Multiply ( double  Scalar)

Definition at line 394 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by operator*(), and operator*=().

◆ Multiply_Cross()

bool CSG_Vector::Multiply_Cross ( const CSG_Vector Vector)

Definition at line 416 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by Get_Cross_Product(), and Multiply().

◆ Multiply_Scalar()

double CSG_Vector::Multiply_Scalar ( const CSG_Vector Vector) const

Definition at line 433 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by Get_Scalar_Product(), and operator*().

◆ operator const double *()

CSG_Vector::operator const double * ( void  ) const
inline

Definition at line 393 of file mat_tools.h.

◆ operator!=()

bool CSG_Vector::operator!= ( const CSG_Vector Vector) const
inline

Definition at line 414 of file mat_tools.h.

◆ operator()()

double CSG_Vector::operator() ( sLong  x) const
inline

Definition at line 386 of file mat_tools.h.

◆ operator*() [1/2]

double CSG_Vector::operator* ( const CSG_Vector Vector) const

Definition at line 574 of file mat_matrix.cpp.

References Multiply_Scalar().

◆ operator*() [2/2]

CSG_Vector CSG_Vector::operator* ( double  Scalar) const

Definition at line 565 of file mat_matrix.cpp.

References Multiply().

◆ operator*=() [1/3]

CSG_Vector & CSG_Vector::operator*= ( const class CSG_Matrix Matrix)

Definition at line 519 of file mat_matrix.cpp.

References Multiply().

◆ operator*=() [2/3]

CSG_Vector & CSG_Vector::operator*= ( const CSG_Vector Vector)

Definition at line 512 of file mat_matrix.cpp.

References Multiply().

◆ operator*=() [3/3]

CSG_Vector & CSG_Vector::operator*= ( double  Scalar)

Definition at line 505 of file mat_matrix.cpp.

References Multiply().

◆ operator+() [1/2]

CSG_Vector CSG_Vector::operator+ ( const CSG_Vector Vector) const

Definition at line 536 of file mat_matrix.cpp.

References Add().

◆ operator+() [2/2]

CSG_Vector CSG_Vector::operator+ ( double  Scalar) const

Definition at line 527 of file mat_matrix.cpp.

References Add().

◆ operator+=() [1/2]

CSG_Vector & CSG_Vector::operator+= ( const CSG_Vector Vector)

Definition at line 482 of file mat_matrix.cpp.

References Add().

◆ operator+=() [2/2]

CSG_Vector & CSG_Vector::operator+= ( double  Scalar)

Definition at line 475 of file mat_matrix.cpp.

References Add().

◆ operator-() [1/2]

CSG_Vector CSG_Vector::operator- ( const CSG_Vector Vector) const

Definition at line 555 of file mat_matrix.cpp.

References Subtract().

◆ operator-() [2/2]

CSG_Vector CSG_Vector::operator- ( double  Scalar) const

Definition at line 546 of file mat_matrix.cpp.

References Add().

◆ operator-=() [1/2]

CSG_Vector & CSG_Vector::operator-= ( const CSG_Vector Vector)

Definition at line 497 of file mat_matrix.cpp.

References Subtract().

◆ operator-=() [2/2]

CSG_Vector & CSG_Vector::operator-= ( double  Scalar)

Definition at line 490 of file mat_matrix.cpp.

References Add().

◆ operator=() [1/2]

CSG_Vector & CSG_Vector::operator= ( const CSG_Vector Vector)

Definition at line 467 of file mat_matrix.cpp.

References Assign().

◆ operator=() [2/2]

CSG_Vector & CSG_Vector::operator= ( double  Scalar)

Definition at line 460 of file mat_matrix.cpp.

References Assign().

◆ operator==()

bool CSG_Vector::operator== ( const CSG_Vector Vector) const
inline

Definition at line 413 of file mat_tools.h.

◆ operator[]() [1/6]

double& CSG_Vector::operator[] ( int  x)
inline

Definition at line 389 of file mat_tools.h.

◆ operator[]() [2/6]

const double& CSG_Vector::operator[] ( int  x) const
inline

Definition at line 392 of file mat_tools.h.

◆ operator[]() [3/6]

double& CSG_Vector::operator[] ( size_t  x)
inline

Definition at line 388 of file mat_tools.h.

◆ operator[]() [4/6]

const double& CSG_Vector::operator[] ( size_t  x) const
inline

Definition at line 391 of file mat_tools.h.

◆ operator[]() [5/6]

double& CSG_Vector::operator[] ( sLong  x)
inline

Definition at line 387 of file mat_tools.h.

◆ operator[]() [6/6]

const double& CSG_Vector::operator[] ( sLong  x) const
inline

Definition at line 390 of file mat_tools.h.

◆ Set_Rows()

bool CSG_Vector::Set_Rows ( sLong  nRows)

Sets the number of rows to nRows. Values will be preserved. Returns true if successful.

Definition at line 140 of file mat_matrix.cpp.

References Add_Rows(), Del_Rows(), and Get_Size().

Referenced by CSG_KDTree_2D::Get_Nearest_Points(), and CSG_KDTree_3D::Get_Nearest_Points().

◆ Set_Unity()

bool CSG_Vector::Set_Unity ( void  )

Definition at line 596 of file mat_matrix.cpp.

References Get_Data(), Get_Length(), and Get_Size().

Referenced by Get_Unity().

◆ Set_Zero()

bool CSG_Vector::Set_Zero ( void  )

Definition at line 590 of file mat_matrix.cpp.

References Create(), and Get_Size().

Referenced by CSG_Matrix::Set_Inverse().

◆ Sort()

bool CSG_Vector::Sort ( bool  bAscending = true)

Definition at line 642 of file mat_matrix.cpp.

References Flip_Values(), Get_Data(), Get_Size(), and SG_Compare_Double().

Referenced by CSG_Natural_Breaks::Create().

◆ Subtract()

bool CSG_Vector::Subtract ( const CSG_Vector Vector)

Definition at line 378 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by operator-(), and operator-=().

◆ to_String()

CSG_String CSG_Vector::to_String ( int  Width = -1,
int  Precision = -1,
bool  bScientific = false,
const SG_Char Separator = NULL 
) const

Definition at line 225 of file mat_matrix.cpp.

References Get_Data(), Get_Size(), SG_Get_Double_asString(), and SG_T.


The documentation for this class was generated from the following files: