Jpp
Public Member Functions | List of all members
JMATH::JVectorND Struct Reference

Nx1 matrix. More...

#include <JVectorND.hh>

Inheritance diagram for JMATH::JVectorND:
std::vector< double > JFIT::JVectorNZ

Public Member Functions

 JVectorND ()
 Default constructor. More...
 
 JVectorND (size_t size)
 Constructor. More...
 
double getDot (const JVectorND &vector) const
 Get dot product. More...
 

Detailed Description

Nx1 matrix.

Definition at line 14 of file JVectorND.hh.

Constructor & Destructor Documentation

◆ JVectorND() [1/2]

JMATH::JVectorND::JVectorND ( )
inline

Default constructor.

Definition at line 20 of file JVectorND.hh.

20  :
22  {}

◆ JVectorND() [2/2]

JMATH::JVectorND::JVectorND ( size_t  size)
inline

Constructor.

Parameters
sizesize

Definition at line 30 of file JVectorND.hh.

30  :
31  std::vector<double>(size, 0.0)
32  {}

Member Function Documentation

◆ getDot()

double JMATH::JVectorND::getDot ( const JVectorND vector) const
inline

Get dot product.

Parameters
vectorvector
Returns
dot product

Definition at line 41 of file JVectorND.hh.

42  {
43  double dot = 0.0;
44 
45  const double* p = this-> data();
46  const double* q = vector.data();
47 
48  for (size_t i = this->size(); i != 0; --i, ++p, ++q) {
49  dot += (*p) * (*q);
50  }
51 
52  return dot;
53  }

The documentation for this struct was generated from the following file:
std::vector< double >