21#ifndef CORE_CARTESIAN_VECTOR_HPP
22#define CORE_CARTESIAN_VECTOR_HPP
96 int16
norm(floating_point &result)
const;
100 floating_point
norm()
const {floating_point tmp;
norm(tmp);
return tmp;}
132 for(uint32 i = 0; i < L; i++) {
139 for(uint32 i = 0; i < L; i++) {
146 :
Matrix<L, 1>(initial) {}
150 :
Matrix<L, 1>(initial) {}
162 for(i = 0; i < L; i++) {
177 for(i = 0; i < L; i++) {
187 floating_point mag = 0.0;
195 for(uint32 i = 0; i < L; i++) {
203 int err =
unit(*
this);
Standard vector class derived from Matrix.
Definition CartesianVector.hpp:39
int16 norm(floating_point &result) const
Function to take the norm of a vector.
Definition CartesianVector.hpp:158
int16 normalize()
Function to unitize the current vector.
Definition CartesianVector.hpp:212
~CartesianVector()
Definition CartesianVector.hpp:67
floating_point get(uint32 idx) const
Getter specific to the vector class.
Definition CartesianVector.hpp:92
int16 unitize()
Function to unitize the current vector.
Definition CartesianVector.hpp:202
floating_point normSquared() const
Function to take the squared norm of a vector.
Definition CartesianVector.hpp:108
int get(uint32 idx, floating_point &result) const
Getter specific to the vector class.
Definition CartesianVector.hpp:86
int16 normSquared(floating_point &result) const
Function to take the squared norm of a vector.
Definition CartesianVector.hpp:173
floating_point norm() const
Function to take the norm of a vector.
Definition CartesianVector.hpp:100
int set(uint32 idx, floating_point value)
Setter specific to the vector class.
Definition CartesianVector.hpp:80
floating_point & operator[](uint32 idx)
Function to return a vector value.
Definition CartesianVector.hpp:153
CartesianVector(floating_point elements)
Constructor to initialize a matrix with all the same element.
Definition CartesianVector.hpp:48
int16 unit(CartesianVector< L > &result) const
Function to return the unitized version of the vector.
Definition CartesianVector.hpp:185
CartesianVector()
Definition CartesianVector.hpp:45
Matrix math implementation.
Definition Matrix.hpp:55
std::array< std::array< floating_point, C >, R > values
Definition Matrix.hpp:213
int16 get(uint32 row, uint32 col, floating_point &result) const
Function to get a single value in the matrix.
Definition Matrix.hpp:394
Matrix()
Definition Matrix.hpp:233
int16 set(uint32 row, uint32 col, const floating_point &value)
Function to set a single value in the matrix.
Definition Matrix.hpp:381
#define NO_ERROR
Error code in the case where matrix math executed successfully.
Definition clockwerkerrors.h:34
#define ERROR_DIVIDE_BY_ZERO
Error code in the case where some fool tried to divide by zero.
Definition clockwerkerrors.h:49
Definition CircularBuffer.hpp:28
int16 safeSqrt(float input, float &result)
Overloaded functions to perform safe square root.
Definition safemath.cpp:57
#define SAFE_MATH_ZERO_TOLERANCE
Definition safemath.h:32