rgb's Books

Robert G. Brown's General Tools Page

Things on the site itself that may be of interest to students or philosophers of any age or generation include complete online books of poetry, various support materials for the study of physics, and links related to beowulfery. All materials on this site that are authored by Robert G. Brown are Copyright 2004. The details of their Open Public License (modified) can be viewed here. If you use or enjoy anything at all on this site -- free textbooks, stories, programs, or other resources, consider hitting to help spread the word so others can find it as well. Note, Robert G. Brown is generally either rgb or rgbatduke on many external sites crosslinked here.

Home
Lilith
Class
Beowulf
Research
General
Poetry
Prose
Philosophy
Search
Contact

Home
Class
Beowulf
Research
General
Poetry
Prose
Philosophy

Brahma
(webalize)
DBUG
(webalize)
DULUG
Linux@Duke

tensor_test

Abstract

tensor_test is a development/test wrapper for a proposed tensor extension of the GSL. Some of the changes it institutes are fairly serious, although it would be possible to implement it with less impact.

• The gsl block is redefined so that it is (also) a gsl vector. Before a vector was a block with an owner. Now a block is a block with an owner, and there is no separate "vector" quantity.
• The gsl matrix is redefined so that it can have any rank from 1 (vector) to 8. It contains lower, upper, and length vectors (each of length equal to the rank of the matrix) that contain the lower and upper bounds of the matrix indices and the over index length. The key feature of the matrix object is the void* matrix->mptr pointer, which can be packed with data addresses from a block and cast to whatever type pointer you like. This permits ALL MATRICES to be addressed in the form m[i][j]...[l][m].
• A gsl tensor is defined to be a matrix and an associated data block whose addresses are packed into the matrix-mptr pointer. It can be created or freed with a single command. However, blocks and matrices can be created and freed separately as well, and (for example) several matrices can refer to the same block or different parts of the same block. Freeing a matrix does not free the underlying data block; freeing a tensor does.

At the moment, the code passes at least one elementary set of tests; the block can be loaded as a straight vector with data elements which can then be successfully referenced by matrix address. In verbose mode, the test code also traces fairly explicitly the memory allocations and freeings (which is still not a guarantee that the code cannot leak or segvec fault). Still, it SEEMS to work out to 8th rank tensors for fairly arbitrary index limits.

Contents

 Document Type Size (K) Last Modified tensor_test/tensor_test-0.0.2-1.src.rpm 27 11/13/13 tensor_test/tensor_test-0.0.2-1.x86_64.rpm 15 11/13/13 tensor_test/tensor_test.i386.rpm 13 11/13/13 tensor_test/tensor_test.src.rpm 27 11/13/13 tensor_test/tensor_test-0.0.2.tgz 24 11/13/13 tensor_test/tensor_test.tgz 24 11/13/13