File: rb_gsl_tensor.h

package info (click to toggle)
ruby-gsl 1.14.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,116 kB
  • sloc: ansic: 62,186; ruby: 17,804; makefile: 18; sh: 15
file content (45 lines) | stat: -rw-r--r-- 1,042 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef ___RB_TENSOR_H___
#define ___RB_TENSOR_H___

#ifdef HAVE_TENSOR_TENSOR_H
#include "rb_gsl.h"
#include "rb_gsl_common.h"
//#include <tensor/tensor.h>
#include <tensor/tensor.h>

EXTERN VALUE cgsl_tensor, cgsl_tensor_int;

enum {
  TENSOR_ADD,
  TENSOR_SUB,
  TENSOR_MUL_ELEMENTS,
  TENSOR_DIV_ELEMENTS,
  TENSOR_SCALE,
  TENSOR_ADD_CONSTANT,
  TENSOR_ADD_DIAGONAL,
  TENSOR_PRODUCT,
  TENSOR_CONTRACT,
};

typedef gsl_permutation tensor_indices;

typedef struct __rbgsl_tensor {
  /*  tensor *tensor;
      tensor_indices *indices;*/
  tensor *tensor;
  tensor_indices *indices;
} rbgsl_tensor;

typedef struct __rbgsl_tensor_int {
  /*  tensor_int *tensor;
      tensor_indices *indices;*/
  tensor_int *tensor;
  tensor_indices *indices;
} rbgsl_tensor_int;

rbgsl_tensor* rbgsl_tensor_alloc(const unsigned int rank, const size_t dimension);
rbgsl_tensor_int* rbgsl_tensor_int_alloc(const unsigned int rank, const size_t dimension);
void rbgsl_tensor_free(rbgsl_tensor*);
void rbgsl_tensor_int_free(rbgsl_tensor_int*);
#endif
#endif