CARLsim
6.1.0
CARLsim: a GPU-accelerated SNN simulator
linear_algebra.cpp
Go to the documentation of this file.
1
#include <
linear_algebra.h
>
2
3
#include <cmath>
// sqrt
4
5
double
dist
(
Point3D
& p1,
Point3D
& p2) {
6
return
norm
((p1-p2)*(p1-p2));
7
}
8
9
double
norm2
(
const
Point3D
& p) {
10
return
(p.
x
*p.
x
+p.
y
*p.
y
+p.
z
*p.
z
);
11
}
12
14
double
norm
(
const
Point3D
& p) {
15
return
sqrt(
norm2
(p));
16
}
Point3D::z
double z
Definition:
linear_algebra.h:87
Point3D::x
double x
Definition:
linear_algebra.h:87
norm2
double norm2(const Point3D &p)
calculate norm^2
Definition:
linear_algebra.cpp:9
Point3D
a point in 3D space
Definition:
linear_algebra.h:59
norm
double norm(const Point3D &p)
Definition:
linear_algebra.cpp:14
dist
double dist(Point3D &p1, Point3D &p2)
Definition:
linear_algebra.cpp:5
linear_algebra.h
Point3D::y
double y
Definition:
linear_algebra.h:87
carlsim
interface
src
linear_algebra.cpp
Generated on Mon Jul 10 2023 12:42:29 for CARLsim by
1.8.13