52 void vector_add_i8(
const T *data1,
const T *data2, T *result_data,
size_t size);
103 const std::vector<int8_t> &vec2,
104 std::vector<int8_t> &result);
113 const std::vector<uint8_t> &vec2,
114 std::vector<uint8_t> &result);
123 const std::vector<int16_t> &vec2,
124 std::vector<int16_t> &result);
133 const std::vector<uint16_t> &vec2,
134 std::vector<uint16_t> &result);
143 const std::vector<int32_t> &vec2,
144 std::vector<int32_t> &result);
153 const std::vector<uint32_t> &vec2,
154 std::vector<uint32_t> &result);
163 const std::vector<int64_t> &vec2,
164 std::vector<int64_t> &result);
173 const std::vector<uint64_t> &vec2,
174 std::vector<uint64_t> &result);
185 template <
typename T>
186 void vector_sub_i8(
const T *data1,
const T *data2, T *result_data,
size_t size);
196 template <
typename T>
210 template <
typename T>
224 template <
typename T>
237 const std::vector<int8_t> &vec2,
238 std::vector<int8_t> &result);
247 const std::vector<uint8_t> &vec2,
248 std::vector<uint8_t> &result);
257 const std::vector<int16_t> &vec2,
258 std::vector<int16_t> &result);
267 const std::vector<uint16_t> &vec2,
268 std::vector<uint16_t> &result);
277 const std::vector<int32_t> &vec2,
278 std::vector<int32_t> &result);
287 const std::vector<uint32_t> &vec2,
288 std::vector<uint32_t> &result);
297 const std::vector<int64_t> &vec2,
298 std::vector<int64_t> &result);
307 const std::vector<uint64_t> &vec2,
308 std::vector<uint64_t> &result);
319 template <
typename T>
330 template <
typename T>
341 template <
typename T>
352 template <
typename T>
363 std::vector<int8_t> &result);
373 std::vector<uint8_t> &result);
383 std::vector<int16_t> &result);
393 std::vector<uint16_t> &result);
403 std::vector<int32_t> &result);
413 std::vector<uint32_t> &result);
423 std::vector<int64_t> &result);
433 std::vector<uint64_t> &result);
444 template <
typename T>
455 template <
typename T>
466 template <
typename T>
477 template <
typename T>
487 const std::vector<int8_t> &vec2);
496 const std::vector<uint8_t> &vec2);
505 const std::vector<int16_t> &vec2);
514 const std::vector<uint16_t> &vec2);
523 const std::vector<int32_t> &vec2);
532 const std::vector<uint32_t> &vec2);
541 const std::vector<int64_t> &vec2);
550 const std::vector<uint64_t> &vec2);
565 const std::vector<double> &vec2,
566 std::vector<double> &result);
579 const std::vector<double> &vec2,
580 std::vector<double> &result);
595 std::vector<double> &result);
607 const std::vector<double> &vec2);
621 template <
typename T>
623 const std::vector<T> &vec2,
624 std::vector<T> &result) {
625 result.resize(vec1.size());
626 for (
size_t i = 0; i < vec1.size(); ++i) {
627 result[i] = vec1[i] + vec2[i];
641 template <
typename T>
643 const std::vector<T> &vec2,
644 std::vector<T> &result) {
645 result.resize(vec1.size());
646 for (
size_t i = 0; i < vec1.size(); ++i) {
647 result[i] = vec1[i] - vec2[i];
661 template <
typename T>
664 std::vector<T> &result) {
665 result.resize(vec.size());
666 for (
size_t i = 0; i < vec.size(); ++i) {
667 result[i] = vec[i] * scalar;
680 template <
typename T>
683 for (
size_t i = 0; i < vec1.size(); ++i) {
684 result += vec1[i] * vec2[i];
700 const std::vector<double> &vec2,
701 std::vector<double> &result);
722 std::vector<double> &result);
735 const std::vector<double> &onto_vec,
736 std::vector<double> &result);
748 const std::vector<int> &vec2,
749 std::vector<int> &result);
771 std::vector<double> &result);
784 const std::vector<int> &onto_vec,
785 std::vector<double> &result);
void scalar_mult_i16(const T *data, int scalar, T *result_data, size_t size)
Performs scalar multiplication for signed 16-bit integers.
void std_cross_product(const std::vector< double > &vec1, const std::vector< double > &vec2, std::vector< double > &result)
Compute the cross product of two 3D vectors.
int dot_product(const std::vector< int8_t > &vec1, const std::vector< int8_t > &vec2)
Computes the dot product for vectors of signed 8-bit integers.
void vector_add_i32(const T *data1, const T *data2, T *result_data, size_t size)
Performs vector addition for signed 32-bit integers.
void vector_add_i8(const T *data1, const T *data2, T *result_data, size_t size)
Performs vector addition for signed 8-bit integers.
T dot_product_i64(const T *vec1, const T *vec2, size_t size)
Computes the dot product for signed 64-bit integer vectors.
void vector_sub_i32(const T *data1, const T *data2, T *result_data, size_t size)
Performs vector subtraction for signed 32-bit integers.
void std_scalar_mult(const std::vector< T > &vec, int scalar, std::vector< T > &result)
Multiply each element of a vector by a scalar.
void vector_add_i16(const T *data1, const T *data2, T *result_data, size_t size)
Performs vector addition for signed 16-bit integers.
void vector_sub(const std::vector< int8_t > &vec1, const std::vector< int8_t > &vec2, std::vector< int8_t > &result)
Performs vector subtraction for vectors of signed 8-bit integers.
void scalar_mult(const std::vector< int8_t > &vec1, int scalar, std::vector< int8_t > &result)
Performs scalar multiplication for vectors of signed 8-bit integers.
void std_vector_sub(const std::vector< T > &vec1, const std::vector< T > &vec2, std::vector< T > &result)
Subtract one vector from another element-wise.
void std_vector_projection(const std::vector< double > &vec, const std::vector< double > &onto_vec, std::vector< double > &result)
Compute the projection of one vector onto another.
void scalar_mult_i32(const T *data, int scalar, T *result_data, size_t size)
Performs scalar multiplication for signed 32-bit integers.
double std_vector_norm(const std::vector< double > &vec)
Compute the Euclidean norm (magnitude) of a vector.
void vector_sub_i8(const T *data1, const T *data2, T *result_data, size_t size)
Performs vector subtraction for signed 8-bit integers.
void std_vector_normalize(const std::vector< double > &vec, std::vector< double > &result)
Normalize a vector to have unit length.
void scalar_mult_i64(const T *data, int scalar, T *result_data, size_t size)
Performs scalar multiplication for signed 64-bit integers.
void vector_add(const std::vector< int8_t > &vec1, const std::vector< int8_t > &vec2, std::vector< int8_t > &result)
Performs vector addition for vectors of signed 8-bit integers.
void vector_sub_i64(const T *data1, const T *data2, T *result_data, size_t size)
Performs vector subtraction for signed 64-bit integers.
T dot_product_i16(const T *vec1, const T *vec2, size_t size)
Computes the dot product for signed 16-bit integer vectors.
T dot_product_i8(const T *vec1, const T *vec2, size_t size)
Computes the dot product for signed 8-bit integer vectors.
void scalar_mult_i8(const T *data, int scalar, T *result_data, size_t size)
Performs scalar multiplication for signed 8-bit integers.
void vector_add_i64(const T *data1, const T *data2, T *result_data, size_t size)
Performs vector addition for signed 64-bit integers.
void std_vector_add(const std::vector< T > &vec1, const std::vector< T > &vec2, std::vector< T > &result)
Add two vectors element-wise.
void vector_sub_i16(const T *data1, const T *data2, T *result_data, size_t size)
Performs vector subtraction for signed 16-bit integers.
T dot_product_i32(const T *vec1, const T *vec2, size_t size)
Computes the dot product for signed 32-bit integer vectors.
T std_dot_product(const std::vector< T > &vec1, const std::vector< T > &vec2)
Compute the dot product of two vectors.
The source C++ openGPMP namespace.