# HG changeset patch # User jwe # Date 1114786606 0 # Node ID d2d11284528e10debaded1f337bcf961cb84edd7 # Parent e5a68648db9ce229b9c77ae4ebcdda605d7cd53a [project @ 2005-04-29 14:56:45 by jwe] diff -r e5a68648db9c -r d2d11284528e doc/ChangeLog --- a/doc/ChangeLog Fri Apr 29 13:10:36 2005 +0000 +++ b/doc/ChangeLog Fri Apr 29 14:56:46 2005 +0000 @@ -1,7 +1,7 @@ 2005-04-29 David Bateman - * interpreter/sparse.txi: Add matrix_type, spkron, and document changes - in solve code + * interpreter/sparse.txi: Add matrix_type, spkron, and document + changes in solve code. 2005-03-14 David Bateman diff -r e5a68648db9c -r d2d11284528e doc/interpreter/sparse.txi --- a/doc/interpreter/sparse.txi Fri Apr 29 13:10:36 2005 +0000 +++ b/doc/interpreter/sparse.txi Fri Apr 29 14:56:46 2005 +0000 @@ -73,7 +73,7 @@ (rows and column) and the third being the data itself. This is conceptually easy to grasp, but requires more storage than is strictly needed. -The storage technique used within @sc{Octave} is compressed column +The storage technique used within Octave is compressed column format. In this format the position of each element in a row and the data are stored as previously. However, if we assume that all elements in the same column are stored adjacent in the computers memory, then @@ -136,10 +136,10 @@ It should be noted that compressed row formats are equally possible. However, in the context of mixed operations between mixed sparse and dense matrices, it makes sense that the elements of the sparse matrices are in the same -order as the dense matrices. @sc{Octave} stores dense matrices in column +order as the dense matrices. Octave stores dense matrices in column major ordering, and so sparse matrices are equally stored in this manner. -A further constraint on the sparse matrix storage used by @sc{Octave} is that +A further constraint on the sparse matrix storage used by Octave is that all elements in the rows are stored in increasing order of their row index. This makes certain operations, later be faster. However, it imposes the need to sort the elements on the creation of sparse matrices. Having @@ -222,7 +222,7 @@ creates an @var{r}-by-@var{c} sparse matrix with a random distribution of 2 elements per row. The elements of the vectors do not need to be sorted in -any particular order as @sc{Octave} will store them prior to storing the +any particular order as Octave will store them prior to storing the data. However, per sorting the data will make teh creation of the sparse matrix faster. @@ -253,7 +253,7 @@ endfor @end example -It should be noted, that due to the way that the @sc{Octave} +It should be noted, that due to the way that the Octave assignment functions are written that the assignment will reallocate the memory used by the sparse matrix at each iteration. Therefore the @dfn{spalloc} function ignores the @var{nz} argument and does not @@ -319,7 +319,7 @@ matrix when it should give a sparse one. In general, where such cases occur, they impose only a small memory penalty. -There is however one known case where this behaviour of @sc{Octave}'s +There is however one known case where this behaviour of Octave's sparse matrices will cause a problem. That is in the handling of the @dfn{diag} function. Whether @dfn{diag} returns a sparse or full matrix depending on the type of its input arguments. So @@ -413,7 +413,7 @@ @node Sparse Linear Algebra, Iterative Techniques, Graph Theory, Sparse Matrices @section Linear Algebra on Sparse Matrices -@sc{Octave} includes a poly-morphic solver for sparse matrices, where +Octave includes a poly-morphic solver for sparse matrices, where the exact solver used to factorize the matrix, depends on the properties of the sparse matrix, itself. The cost of determining the matrix type is small relative to the cost of factorizing the matrix itself, but in any @@ -507,7 +507,7 @@ @node Oct-Files, License, Iterative Techniques, Sparse Matrices @section Using Sparse Matrices in Oct-files -An oct-file is a means of writing an @sc{Octave} function in a compilable +An oct-file is a means of writing an Octave function in a compilable language like C++, rather than as a script file. This results in a significant acceleration in the code. It is not the purpose of this section to discuss how to write an oct-file, or discuss what they @@ -535,18 +535,18 @@ All of these classes inherit from the @code{Sparse} template class, and so all have similar capabilities and usage. The @code{Sparse} -class was based on @sc{Octave} @code{Array} class, and so users familar -with @sc{Octave}'s Array classes will be comfortable with the use of +class was based on Octave @code{Array} class, and so users familar +with Octave's Array classes will be comfortable with the use of the sparse classes. The sparse classes will not be entirely described in this section, due to their similar with the existing Array classes. However, there are a few differences due the different nature of sparse objects, and these will be described. Firstly, although it is fundamentally possible to -have N-dimensional sparse objects, the @sc{Octave} sparse classes do +have N-dimensional sparse objects, the Octave sparse classes do not allow them at this time. So all operations of the sparse classes must be 2-dimensional. This means that in fact @code{SparseMatrix} is -similar to @sc{Octave}'s @code{Matrix} class rather than its +similar to Octave's @code{Matrix} class rather than its @code{NDArray} class. @menu @@ -581,7 +581,7 @@ Extreme care must be take with the elem method and the "()" operator, which perform basically the same function. The reason is that if a -sparse object is non-const, then @sc{Octave} will assume that a +sparse object is non-const, then Octave will assume that a request for a zero element in a sparse matrix is in fact a request to create this element so it can be filled. Therefore a piece of code like @@ -619,7 +619,7 @@ block of memory, the @code{fortran_vec} method of the @code{Array} is not available. It is however replaced by three seperate methods @code{ridx}, @code{cidx} and @code{data}, that access the raw compressed -column format that the @sc{Octave} sparse matrices are stored in. +column format that the Octave sparse matrices are stored in. Additionally, these methods can be used in a manner similar to @code{elem}, to allow the matrix to be accessed or filled. However, in that case it is up to the user to repect the sparse matrix compressed column format @@ -815,7 +815,7 @@ @subsection Using Sparse Matrices in Oct-Files Most of the same operators and functions on sparse matrices that are -available from the @sc{Octave} are equally available with oct-files. +available from the Octave are equally available with oct-files. The basic means of extracting a sparse matrix from an @code{octave_value} and returning them as an @code{octave_value}, can be seen in the following example @@ -840,7 +840,7 @@ @node License, Function Reference, Oct-Files, Sparse Matrices @section Licensing of Third Party Software -There are several third party software packages used by the @sc{Octave} +There are several third party software packages used by the Octave sparse matrix. @table @asis diff -r e5a68648db9c -r d2d11284528e src/DLD-FUNCTIONS/matrix_type.cc --- a/src/DLD-FUNCTIONS/matrix_type.cc Fri Apr 29 13:10:36 2005 +0000 +++ b/src/DLD-FUNCTIONS/matrix_type.cc Fri Apr 29 14:56:46 2005 +0000 @@ -87,7 +87,7 @@ \n\ Note that the matrix type will be discovered automatically on the first attempt to\n\ solve a linear equation involving @var{a}. Therefore @code{matrix_type} is only\n\ -useful to give @sc{Octave} hints of the matrix type. Incorrectly defining the\n\ +useful to give Octave hints of the matrix type. Incorrectly defining the\n\ matrix type will result in incorrect results from solutions of linear equations,\n\ and so it is entirely the responsibility of the user to correctly indentify the\n\ matrix type.\n\ diff -r e5a68648db9c -r d2d11284528e src/DLD-FUNCTIONS/sparse.cc --- a/src/DLD-FUNCTIONS/sparse.cc Fri Apr 29 13:10:36 2005 +0000 +++ b/src/DLD-FUNCTIONS/sparse.cc Fri Apr 29 14:56:46 2005 +0000 @@ -475,8 +475,8 @@ DEFUN_DLD (nzmax, args, , "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{scalar} =} nzmax (@var{SM})\n\ -Returns the amount of storage allocated to the sparse matrix @var{SM}.\n\ -Note that @sc{Octave} tends to crop unused memory at the first oppurtunity\n\ +Return the amount of storage allocated to the sparse matrix @var{SM}.\n\ +Note that Octave tends to crop unused memory at the first oppurtunity\n\ for sparse objects. There are some cases of user created sparse objects\n\ where the value returned by @dfn{nzmaz} will not be the same as @dfn{nnz},\n\ but in general they will give the same result.\n\