aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/algebra/Makefile.am3
-rw-r--r--src/algebra/Makefile.in3
-rw-r--r--src/algebra/matcat.spad.pamphlet84
-rw-r--r--src/interp/define.boot11
5 files changed, 18 insertions, 88 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 653ed939..1b97ccab 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2013-05-15 Gabriel Dos Reis <gdr@integrable-solutions.net>
+ * interp/define.boot (dbClearForCompilation!): New.
+ (compDefineFunctor1): Use it.
+
+2013-05-15 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
* interp/nruncomp.boot (NRTputInHead): Tidy.
2013-05-14 Gabriel Dos Reis <gdr@integrable-solutions.net>
diff --git a/src/algebra/Makefile.am b/src/algebra/Makefile.am
index 2505b85a..50bf1aa0 100644
--- a/src/algebra/Makefile.am
+++ b/src/algebra/Makefile.am
@@ -1736,7 +1736,8 @@ $(OUT)/QFORM.$(FASLEXT): $(OUT)/SQMATRIX.$(FASLEXT)
$(OUT)/SQMATRIX.$(FASLEXT): $(OUT)/SMATCAT.$(FASLEXT) \
$(OUT)/MATRIX.$(FASLEXT) $(OUT)/IARRAY2.$(FASLEXT)
$(OUT)/SMATCAT.$(FASLEXT): $(OUT)/RMATCAT.$(FASLEXT)
-$(OUT)/RMATCAT.$(FASLEXT): $(OUT)/DIRPROD.$(FASLEXT)
+$(OUT)/RMATCAT.$(FASLEXT): $(OUT)/MATCAT.$(FASLEXT) \
+ $(OUT)/DIRPROD.$(FASLEXT)
$(OUT)/DIRPROD.$(FASLEXT): $(OUT)/DIRPCAT.$(FASLEXT)
$(OUT)/DIRPCAT.$(FASLEXT): $(OUT)/VSPACE.$(FASLEXT)
$(OUT)/MATRIX.$(FASLEXT): $(OUT)/MATCAT.$(FASLEXT)
diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in
index efab0a51..a7485cfc 100644
--- a/src/algebra/Makefile.in
+++ b/src/algebra/Makefile.in
@@ -2902,7 +2902,8 @@ $(OUT)/QFORM.$(FASLEXT): $(OUT)/SQMATRIX.$(FASLEXT)
$(OUT)/SQMATRIX.$(FASLEXT): $(OUT)/SMATCAT.$(FASLEXT) \
$(OUT)/MATRIX.$(FASLEXT) $(OUT)/IARRAY2.$(FASLEXT)
$(OUT)/SMATCAT.$(FASLEXT): $(OUT)/RMATCAT.$(FASLEXT)
-$(OUT)/RMATCAT.$(FASLEXT): $(OUT)/DIRPROD.$(FASLEXT)
+$(OUT)/RMATCAT.$(FASLEXT): $(OUT)/MATCAT.$(FASLEXT) \
+ $(OUT)/DIRPROD.$(FASLEXT)
$(OUT)/DIRPROD.$(FASLEXT): $(OUT)/DIRPCAT.$(FASLEXT)
$(OUT)/DIRPCAT.$(FASLEXT): $(OUT)/VSPACE.$(FASLEXT)
$(OUT)/MATRIX.$(FASLEXT): $(OUT)/MATCAT.$(FASLEXT)
diff --git a/src/algebra/matcat.spad.pamphlet b/src/algebra/matcat.spad.pamphlet
index c895e038..0a74157c 100644
--- a/src/algebra/matcat.spad.pamphlet
+++ b/src/algebra/matcat.spad.pamphlet
@@ -569,90 +569,8 @@ RectangularMatrixCategory(m,n,R,Row,Col): Category == Definition where
Row : DirectProductCategory(n,R)
Col : DirectProductCategory(m,R)
- Definition ==> Join(BiModule(R,R),HomogeneousAggregate(R)) with
-
- finiteAggregate
- ++ matrices are finite
-
+ Definition == Join(MatrixCategory(R,Row,Col),BiModule(R,R)) with
if R has CommutativeRing then Module(R)
-
---% Matrix creation
-
- matrix: List List R -> %
- ++ \spad{matrix(l)} converts the list of lists l to a matrix, where the
- ++ list of lists is viewed as a list of the rows of the matrix.
-
---% Predicates
-
- square? : % -> Boolean
- ++ \spad{square?(m)} returns true if m is a square matrix (i.e. if m
- ++ has the same number of rows as columns) and false otherwise.
- diagonal?: % -> Boolean
- ++ \spad{diagonal?(m)} returns true if the matrix m is square and diagonal
- ++ (i.e. all entries of m not on the diagonal are zero) and false
- ++ otherwise.
- symmetric?: % -> Boolean
- ++ \spad{symmetric?(m)} returns true if the matrix m is square and
- ++ symmetric (i.e. \spad{m[i,j] = m[j,i]} for all \spad{i} and j) and
- ++ false otherwise.
- antisymmetric?: % -> Boolean
- ++ \spad{antisymmetric?(m)} returns true if the matrix m is square and
- ++ antisymmetric (i.e. \spad{m[i,j] = -m[j,i]} for all \spad{i} and j)
- ++ and false otherwise.
-
---% Size inquiries
-
- minRowIndex : % -> Integer
- ++ \spad{minRowIndex(m)} returns the index of the 'first' row of the
- ++ matrix m.
- maxRowIndex : % -> Integer
- ++ \spad{maxRowIndex(m)} returns the index of the 'last' row of the
- ++ matrix m.
- minColIndex : % -> Integer
- ++ \spad{minColIndex(m)} returns the index of the 'first' column of the
- ++ matrix m.
- maxColIndex : % -> Integer
- ++ \spad{maxColIndex(m)} returns the index of the 'last' column of the
- ++ matrix m.
- nrows : % -> NonNegativeInteger
- ++ \spad{nrows(m)} returns the number of rows in the matrix m.
- ncols : % -> NonNegativeInteger
- ++ \spad{ncols(m)} returns the number of columns in the matrix m.
-
---% Part extractions
-
- listOfLists: % -> List List R
- ++ \spad{listOfLists(m)} returns the rows of the matrix m as a list
- ++ of lists.
- elt: (%,Integer,Integer) -> R
- ++ \spad{elt(m,i,j)} returns the element in the \spad{i}th row and
- ++ \spad{j}th column of the matrix m.
- ++ Error: if indices are outside the proper
- ++ ranges.
- qelt: (%,Integer,Integer) -> R
- ++ \spad{qelt(m,i,j)} returns the element in the \spad{i}th row and
- ++ \spad{j}th column of
- ++ the matrix m. Note: there is NO error check to determine if indices are
- ++ in the proper ranges.
- elt: (%,Integer,Integer,R) -> R
- ++ \spad{elt(m,i,j,r)} returns the element in the \spad{i}th row and
- ++ \spad{j}th column of the matrix m, if m has an \spad{i}th row and a
- ++ \spad{j}th column, and returns r otherwise.
- row: (%,Integer) -> Row
- ++ \spad{row(m,i)} returns the \spad{i}th row of the matrix m.
- ++ Error: if the index is outside the proper range.
- column: (%,Integer) -> Col
- ++ \spad{column(m,j)} returns the \spad{j}th column of the matrix m.
- ++ Error: if the index outside the proper range.
-
---% Map and Zip
-
- map: (R -> R,%) -> %
- ++ \spad{map(f,a)} returns b, where \spad{b(i,j) = a(i,j)} for all i, j.
- map:((R,R) -> R,%,%) -> %
- ++ \spad{map(f,a,b)} returns c, where c is such that
- ++ \spad{c(i,j) = f(a(i,j),b(i,j))} for all \spad{i}, j.
-
--% Arithmetic
if R has IntegralDomain then
diff --git a/src/interp/define.boot b/src/interp/define.boot
index 7228ea44..6603f489 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -1384,6 +1384,13 @@ AMFCR_,redefined(opname,u) ==
op in '(PROGN SEQ) => AMFCR_,redefinedList(opname,l)
op = '%when => "OR"/[AMFCR_,redefinedList(opname,rest u) for u in l]
+dbClearForCompilation! db ==
+ dbTemplate(db) := nil
+ dbLookupFunction(db) := nil
+ dbCapsuleDefinitions(db) := nil
+ dbModemaps(db) := nil
+ dbDocumentation(db) := nil
+
substituteCategoryArguments(argl,catform) ==
argl := substitute("$$","$",argl)
applySubst(pairList($FormalMapVariableList,argl),catform)
@@ -1417,12 +1424,10 @@ compDefineFunctor1(df is ['DEF,form,signature,body],m,$e,$formalArgList) ==
$genSDVar: local:= 0
originale:= $e
db := constructorDB $op
+ dbClearForCompilation! db
dbConstructorForm(db) := form
dbCompilerData(db) := makeCompilationData()
dbFormalSubst(db) := pairList(form.args,$FormalMapVariableList)
- dbTemplate(db) := nil
- dbLookupFunction(db) := nil
- dbCapsuleDefinitions(db) := nil
$e := registerConstructor($op,$e)
deduceImplicitParameters(db,$e)
$formalArgList:= [:form.args,:$formalArgList]