NAMD
Classes | Macros | Functions
Vector.h File Reference
#include <math.h>
#include <stdio.h>
#include "common.h"
#include <cuda_runtime.h>

Go to the source code of this file.

Classes

class  FloatVector
 
class  Vector
 
class  zVector
 
class  AlignVector
 

Macros

#define namd_rsqrt(x)   (1.0 / sqrt (x))
 
#define namd_reciprocal(x)   (1.0 / x)
 

Functions

NAMD_HOST_DEVICE float3 operator- (float3 a, float3 b)
 
NAMD_HOST_DEVICE double3 operator- (double3 a, double3 b)
 
NAMD_HOST_DEVICE float3 operator+ (float3 a, float3 b)
 
NAMD_HOST_DEVICE double3 operator+ (double3 a, double3 b)
 
NAMD_HOST_DEVICE float3 make_float3 (float4 a)
 
NAMD_HOST_DEVICE float3 make_float3 (double3 a)
 
NAMD_HOST_DEVICE double3 make_double3 (float3 a)
 
NAMD_HOST_DEVICE double3 make_double3 (float4 a)
 

Macro Definition Documentation

◆ namd_reciprocal

#define namd_reciprocal (   x)    (1.0 / x)

◆ namd_rsqrt

#define namd_rsqrt (   x)    (1.0 / sqrt (x))

Definition at line 68 of file Vector.h.

Referenced by ExclElem::computeForce(), and Vector::rlength().

Function Documentation

◆ make_double3() [1/2]

NAMD_HOST_DEVICE double3 make_double3 ( float3  a)

Definition at line 343 of file Vector.h.

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

343  {
344  return make_double3((double) a.x, (double) a.y, (double) a.z);
345 }
NAMD_HOST_DEVICE double3 make_double3(float3 a)
Definition: Vector.h:343

◆ make_double3() [2/2]

NAMD_HOST_DEVICE double3 make_double3 ( float4  a)

Definition at line 347 of file Vector.h.

References make_double3().

347  {
348  return make_double3((double) a.x, (double) a.y, (double) a.z);
349 }
NAMD_HOST_DEVICE double3 make_double3(float3 a)
Definition: Vector.h:343

◆ make_float3() [1/2]

NAMD_HOST_DEVICE float3 make_float3 ( float4  a)

Definition at line 335 of file Vector.h.

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

335  {
336  return make_float3(a.x, a.y, a.z);
337 }
NAMD_HOST_DEVICE float3 make_float3(float4 a)
Definition: Vector.h:335

◆ make_float3() [2/2]

NAMD_HOST_DEVICE float3 make_float3 ( double3  a)

Definition at line 339 of file Vector.h.

References make_float3().

339  {
340  return make_float3((float) a.x, (float) a.y, (float) a.z);
341 }
NAMD_HOST_DEVICE float3 make_float3(float4 a)
Definition: Vector.h:335

◆ operator+() [1/2]

NAMD_HOST_DEVICE float3 operator+ ( float3  a,
float3  b 
)

Definition at line 327 of file Vector.h.

References make_float3().

327  {
328  return make_float3(a.x + b.x, a.y + b.y, a.z + b.z);
329 }
NAMD_HOST_DEVICE float3 make_float3(float4 a)
Definition: Vector.h:335

◆ operator+() [2/2]

NAMD_HOST_DEVICE double3 operator+ ( double3  a,
double3  b 
)

Definition at line 331 of file Vector.h.

References make_double3().

331  {
332  return make_double3(a.x + b.x, a.y + b.y, a.z + b.z);
333 }
NAMD_HOST_DEVICE double3 make_double3(float3 a)
Definition: Vector.h:343

◆ operator-() [1/2]

NAMD_HOST_DEVICE float3 operator- ( float3  a,
float3  b 
)

Definition at line 319 of file Vector.h.

References make_float3().

319  {
320  return make_float3(a.x - b.x, a.y - b.y, a.z - b.z);
321 }
NAMD_HOST_DEVICE float3 make_float3(float4 a)
Definition: Vector.h:335

◆ operator-() [2/2]

NAMD_HOST_DEVICE double3 operator- ( double3  a,
double3  b 
)

Definition at line 323 of file Vector.h.

References make_double3().

323  {
324  return make_double3(a.x - b.x, a.y - b.y, a.z - b.z);
325 }
NAMD_HOST_DEVICE double3 make_double3(float3 a)
Definition: Vector.h:343