Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2004-07-13 15:42:13 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2004-07-13 15:42:13 +0400
commit4f1c674ee02e07a6986a54a312d7fb9e2547e950 (patch)
tree5c177fa0eb7a22fd81c259d57f7963489e666a7b /intern/opennl/superlu/relax_snode.c
parent4a13a5720db5e54984de2cf3e58a1108f52d1833 (diff)
Added SuperLU 3.0:
http://crd.lbl.gov/~xiaoye/SuperLU/ This is a library to solve sparse matrix systems (type A*x=B). It is able to solve large systems very FAST. Only the necessary parts of the library are included to limit file size and compilation time. This means the example files, fortran interface, test files, matlab interface, cblas library, complex number part and build system have been left out. All (gcc) warnings have been fixed too. This library will be used for LSCM UV unwrapping. With this library, LSCM unwrapping can be calculated in a split second, making the unwrapping proces much more interactive. Added OpenNL (Open Numerical Libary): http://www.loria.fr/~levy/OpenNL/ OpenNL is a library to easily construct and solve sparse linear systems. We use a stripped down version, as an interface to SuperLU. This library was kindly given to use by Bruno Levy.
Diffstat (limited to 'intern/opennl/superlu/relax_snode.c')
-rw-r--r--intern/opennl/superlu/relax_snode.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/intern/opennl/superlu/relax_snode.c b/intern/opennl/superlu/relax_snode.c
new file mode 100644
index 00000000000..549f3fcf873
--- /dev/null
+++ b/intern/opennl/superlu/relax_snode.c
@@ -0,0 +1,71 @@
+/*
+ * -- SuperLU routine (version 2.0) --
+ * Univ. of California Berkeley, Xerox Palo Alto Research Center,
+ * and Lawrence Berkeley National Lab.
+ * November 15, 1997
+ *
+ */
+/*
+ Copyright (c) 1994 by Xerox Corporation. All rights reserved.
+
+ THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
+ EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
+
+ Permission is hereby granted to use or copy this program for any
+ purpose, provided the above notices are retained on all copies.
+ Permission to modify the code and to distribute modified code is
+ granted, provided the above notices are retained, and a notice that
+ the code was modified is included with the above copyright notice.
+*/
+
+#include "ssp_defs.h"
+
+void
+relax_snode (
+ const int n,
+ int *et, /* column elimination tree */
+ const int relax_columns, /* max no of columns allowed in a
+ relaxed snode */
+ int *descendants, /* no of descendants of each node
+ in the etree */
+ int *relax_end /* last column in a supernode */
+ )
+{
+/*
+ * Purpose
+ * =======
+ * relax_snode() - Identify the initial relaxed supernodes, assuming that
+ * the matrix has been reordered according to the postorder of the etree.
+ *
+ */
+ register int j, parent;
+ register int snode_start; /* beginning of a snode */
+
+ ifill (relax_end, n, EMPTY);
+ for (j = 0; j < n; j++) descendants[j] = 0;
+
+ /* Compute the number of descendants of each node in the etree */
+ for (j = 0; j < n; j++) {
+ parent = et[j];
+ if ( parent != n ) /* not the dummy root */
+ descendants[parent] += descendants[j] + 1;
+ }
+
+ /* Identify the relaxed supernodes by postorder traversal of the etree. */
+ for (j = 0; j < n; ) {
+ parent = et[j];
+ snode_start = j;
+ while ( parent != n && descendants[parent] < relax_columns ) {
+ j = parent;
+ parent = et[j];
+ }
+ /* Found a supernode with j being the last column. */
+ relax_end[snode_start] = j; /* Last column is recorded */
+ j++;
+ /* Search for a new leaf */
+ while ( descendants[j] != 0 && j < n ) j++;
+ }
+
+ /*printf("No of relaxed snodes: %d; relaxed columns: %d\n",
+ nsuper, no_relaxed_col); */
+}