aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-07-03 09:08:49 +0000
committerdos-reis <gdr@axiomatics.org>2010-07-03 09:08:49 +0000
commit10d3c5a3fc28b4931ad22d65b3a12e4b7a6d5083 (patch)
tree45eaebe6a127a16c955bb8edde89b686e151208a /src/algebra
parent39f049f645d6b8a7f412a1d2d4a15c1fd4b14efb (diff)
downloadopen-axiom-10d3c5a3fc28b4931ad22d65b3a12e4b7a6d5083.tar.gz
* algebra/vector.spad.pamphlet (DualBasis): New.
(LinearBasis): Likewise. (LinearElement): Use them. (LinearForm): New.
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/Makefile.in13
-rw-r--r--src/algebra/Makefile.pamphlet13
-rw-r--r--src/algebra/exposed.lsp.pamphlet3
-rw-r--r--src/algebra/vector.spad.pamphlet109
4 files changed, 122 insertions, 16 deletions
diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in
index 5d04110f..690e7630 100644
--- a/src/algebra/Makefile.in
+++ b/src/algebra/Makefile.in
@@ -612,7 +612,6 @@ $(OUT)/DIRPROD.$(FASLEXT): $(OUT)/DIRPCAT.$(FASLEXT)
$(OUT)/DIRPCAT.$(FASLEXT): $(OUT)/VSPACE.$(FASLEXT) $(OUT)/IVECTOR.$(FASLEXT)
$(OUT)/MATRIX.$(FASLEXT): $(OUT)/MATCAT.$(FASLEXT)
$(OUT)/BTAGG.$(FASLEXT): $(OUT)/BOOLE.$(FASLEXT)
-$(OUT)/LINELT.$(FASLEXT): $(OUT)/VSPACE.$(FASLEXT) $(OUT)/FM.$(FASLEXT)
axiom_algebra_layer_10 = \
RESULT BFUNCT BPADIC ANY \
@@ -641,7 +640,7 @@ axiom_algebra_layer_10 = \
FUNDESC XPBWPOLY SMATCAT SMATCAT- \
RMATRIX RMATCAT RMATCAT- DIRPROD \
DIRPCAT DIRPCAT- IVECTOR MATRIX \
- MATCAT MATCAT- IIARRAY2 LINELT
+ MATCAT MATCAT- IIARRAY2
axiom_algebra_layer_10_nrlibs = \
@@ -983,7 +982,8 @@ axiom_algebra_layer_user = \
ASP78 ASP9 ASP12 ASP55 ASP8 ASP19 \
ASP20 ASP30 ASP31 ASP35 ASP41 ASP42 \
ASP74 ASP77 ASP80 ASP29 IRFORM COMPILER \
- ITFORM ELABOR TALGOP YDIAGRAM
+ ITFORM ELABOR TALGOP YDIAGRAM LINELT DBASIS \
+ LINFORM LINBASIS
axiom_algebra_layer_user_nrlibs = \
$(addsuffix .NRLIB/code.$(FASLEXT),$(axiom_algebra_layer_user))
@@ -1064,6 +1064,13 @@ $(OUT)/ELABOR.$(FASLEXT): $(OUT)/ITFORM.$(FASLEXT) $(OUT)/ENV.$(FASLEXT) \
$(OUT)/IRFORM.$(FASLEXT)
+$(OUT)/LINBASIS.$(FASLEXT): $(OUT)/ORDFIN.$(FASLEXT) $(OUT)/OVAR.$(FASLEXT)
+$(OUT)/LINELT.$(FASLEXT): $(OUT)/VSPACE.$(FASLEXT) $(OUT)/FM.$(FASLEXT)
+$(OUT)/DBASIS.$(FASLEXT): $(OUT)/ORDFIN.$(FASLEXT) $(OUT)/KVTFROM.$(FASLEXT)
+$(OUT)/LINFORM.$(FASLEXT): $(OUT)/DBASIS.$(FASLEXT) \
+ $(OUT)/VSPACE.$(FASLEXT) $(OUT)/LINELT.$(FASLEXT)
+
+
.PHONY: all all-algebra mkdir-output-directory
all: all-ax
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 2a600ccb..d0d6cc7e 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -619,7 +619,6 @@ $(OUT)/DIRPROD.$(FASLEXT): $(OUT)/DIRPCAT.$(FASLEXT)
$(OUT)/DIRPCAT.$(FASLEXT): $(OUT)/VSPACE.$(FASLEXT) $(OUT)/IVECTOR.$(FASLEXT)
$(OUT)/MATRIX.$(FASLEXT): $(OUT)/MATCAT.$(FASLEXT)
$(OUT)/BTAGG.$(FASLEXT): $(OUT)/BOOLE.$(FASLEXT)
-$(OUT)/LINELT.$(FASLEXT): $(OUT)/VSPACE.$(FASLEXT) $(OUT)/FM.$(FASLEXT)
axiom_algebra_layer_10 = \
RESULT BFUNCT BPADIC ANY \
@@ -648,7 +647,7 @@ axiom_algebra_layer_10 = \
FUNDESC XPBWPOLY SMATCAT SMATCAT- \
RMATRIX RMATCAT RMATCAT- DIRPROD \
DIRPCAT DIRPCAT- IVECTOR MATRIX \
- MATCAT MATCAT- IIARRAY2 LINELT
+ MATCAT MATCAT- IIARRAY2
axiom_algebra_layer_10_nrlibs = \
@@ -1062,7 +1061,8 @@ axiom_algebra_layer_user = \
ASP78 ASP9 ASP12 ASP55 ASP8 ASP19 \
ASP20 ASP30 ASP31 ASP35 ASP41 ASP42 \
ASP74 ASP77 ASP80 ASP29 IRFORM COMPILER \
- ITFORM ELABOR TALGOP YDIAGRAM
+ ITFORM ELABOR TALGOP YDIAGRAM LINELT DBASIS \
+ LINFORM LINBASIS
axiom_algebra_layer_user_nrlibs = \
$(addsuffix .NRLIB/code.$(FASLEXT),$(axiom_algebra_layer_user))
@@ -1142,6 +1142,13 @@ $(OUT)/ITFORM.$(FASLEXT): $(OUT)/IRFORM.$(FASLEXT)
$(OUT)/ELABOR.$(FASLEXT): $(OUT)/ITFORM.$(FASLEXT) $(OUT)/ENV.$(FASLEXT) \
$(OUT)/IRFORM.$(FASLEXT)
+
+$(OUT)/LINBASIS.$(FASLEXT): $(OUT)/ORDFIN.$(FASLEXT) $(OUT)/OVAR.$(FASLEXT)
+$(OUT)/LINELT.$(FASLEXT): $(OUT)/VSPACE.$(FASLEXT) $(OUT)/FM.$(FASLEXT)
+$(OUT)/DBASIS.$(FASLEXT): $(OUT)/ORDFIN.$(FASLEXT) $(OUT)/KVTFROM.$(FASLEXT)
+$(OUT)/LINFORM.$(FASLEXT): $(OUT)/DBASIS.$(FASLEXT) \
+ $(OUT)/VSPACE.$(FASLEXT) $(OUT)/LINELT.$(FASLEXT)
+
@
\section{Broken Files}
diff --git a/src/algebra/exposed.lsp.pamphlet b/src/algebra/exposed.lsp.pamphlet
index ba666e3a..3acfbcfe 100644
--- a/src/algebra/exposed.lsp.pamphlet
+++ b/src/algebra/exposed.lsp.pamphlet
@@ -126,6 +126,7 @@
(|DrawComplex| . DRAWCX)
(|DrawNumericHack| . DRAWHACK)
(|DrawOption| . DROPT)
+ (|DualBasis| . DBASIS)
(|EigenPackage| . EP)
(|ElaboratedExpression| . ELABEXPR)
(|ElementaryFunctionDefiniteIntegration| . DEFINTEF)
@@ -231,7 +232,9 @@
(|LetAst| . LETAST)
(|Library| . LIB)
(|LieSquareMatrix| . LSQM)
+ (|LinearBasis| . LINBASIS)
(|LinearElement| . LINELT)
+ (|LinearForm| . LINFORM)
(|LinearOrdinaryDifferentialOperator| . LODO)
(|LinearSystemMatrixPackage| . LSMP)
(|LinearSystemMatrixPackage1| . LSMP1)
diff --git a/src/algebra/vector.spad.pamphlet b/src/algebra/vector.spad.pamphlet
index 05474370..a708524a 100644
--- a/src/algebra/vector.spad.pamphlet
+++ b/src/algebra/vector.spad.pamphlet
@@ -450,11 +450,49 @@ DirectProductFunctions2(dim, A, B): Exports == Implementation where
\section{Vector space of finite dimension given by a basis}
+
+<<domain LINBASIS LinearBasis>>=
+++ Author: Gabriel Dos Reis
+++ Date Created: July 2, 2010
+++ Date Last Modified: July 2, 2010
+++ Descrption:
+++ Representation of a vector space basis, given by symbols.
+)abbrev domain LINBASIS LinearBasis
+LinearBasis(vars: List Symbol): Public == Private where
+ Public == Join(OrderedFinite,CoercibleFrom OrderedVariableList vars) with
+ dual: DualBasis vars -> %
+ ++ \spad{dual f} constructs the dual vector of a linear form
+ ++ which is part of a basis.
+ Private == OrderedVariableList vars add
+ coerce(s: Rep): % == per s
+ dual f == index(lookup f)@%
+
+@
+
+<<domain DBASIS DualBasis>>=
+++ Author: Gabriel Dos Reis
+++ Date Created: July 2, 2010
+++ Date Last Modified: July 2, 2010
+++ Descrption:
+++ Representation of a dual vector space basis, given by symbols.
+)abbrev domain DBASIS DualBasis
+DualBasis(vars: List Symbol): Public == Private where
+ Public == Join(OrderedFinite) with
+ dual: LinearBasis vars -> %
+ ++ \spad{dual x} constructs the dual vector of a linear element
+ ++ which is part of a basis.
+ Private == OrderedVariableList vars add
+ dual v == index(lookup v)@%
+ coerce(x: %): OutputForm ==
+ superscript(convert(rep x)@Symbol,['_*::OutputForm])::OutputForm
+
+@
+
<<domain LINELT LinearElement>>=
)abbrev domain LINELT LinearElement
++ Author: Gabriel Dos Reis
++ Date Created: June 30, 2010
-++ Date Last Modified: June 30, 2010
+++ Date Last Modified: July 2, 2010
++ Description:
++ A simple data structure for elements that form a
++ vector space of finite dimension over a given field,
@@ -462,12 +500,13 @@ DirectProductFunctions2(dim, A, B): Exports == Implementation where
LinearElement(K,B): Public == Private where
K: Field
B: List Symbol
- macro Basis == OrderedVariableList B
- Public == Join(VectorSpace K,CoercibleFrom Basis) with
- linearElement: (List K,List Basis) -> %
- ++ \spad{linearElement([x1,..,xn],[b1,..,bn]) constructs
- ++ a linear element with coordinates \spad{[x1,..,xn]} with
- ++ respect to the basis elements \spad{b1},...\spad{bn}.
+ macro Basis == LinearBasis B
+ Public == Join(VectorSpace K,CoercibleFrom Basis,_
+ IndexedDirectProductCategory(K,Basis)) with
+ linearElement: List K -> %
+ ++ \spad{linearElement [x1,..,xn]} returns a linear element
+ ++ with coordinates \spad{[x1,..,xn]} with respect to
+ ++ the basis elements \spad{B}.
coordinates: % -> Vector K
++ \spad{coordinates x} returns the coordinates of the linear
++ element with respect to the basis \spad{B}.
@@ -478,10 +517,9 @@ LinearElement(K,B): Public == Private where
dimension() ==
size()$Basis::CardinalNumber
- linearElement(cs,bs) ==
- null cs or null bs => per 0$Rep
+ linearElement cs ==
reduce(_+@(%,%)->%,
- [per monomial(c,b) for c in cs for b in bs])
+ [per monomial(c,index(i)$Basis) for c in cs for i in 1..],0)
coordinates x ==
n := #B
@@ -496,7 +534,53 @@ LinearElement(K,B): Public == Private where
@
+<<domain LINFORM LinearForm>>=
+)abbrev domain LINFORM LinearForm
+++ Author: Gabriel Dos Reis
+++ Date Created: July 2, 2010
+++ Date Last Modified: July 2, 2010
+++ Description:
+++ A simple data structure for linear forms on a vector space of
+++ finite dimension over a given field, with a given symbolic basis.
+LinearForm(K,B): Public == Private where
+ K: Field
+ B: List Symbol
+ macro Basis == DualBasis B
+ Public == Join(VectorSpace K,Eltable(LinearElement(K,B),K)) with
+ linearForm: List K -> %
+ ++ \spad{linearForm [x1,..,xn]} constructs
+ ++ a linear form with coordinates \spad{[x1,..,xn]} with
+ ++ respect to the basis elements \spad{DualBasis B}.
+ coordinates: % -> Vector K
+ ++ \spad{coordinates x} returns the coordinates of the linear
+ ++ form with respect to the basis \spad{DualBasis B}.
+ Private == FreeModule(K,Basis) add
+ dimension() ==
+ size()$Basis::CardinalNumber
+
+ linearForm cs ==
+ reduce(_+@(%,%)->%,
+ [per monomial(c,index(i)$Basis) for c in cs for i in 1..],0)
+
+ coordinates f ==
+ n := #B
+ v: Vector K := new(n,0$K)
+ ts := terms rep f
+ for i in 1..n repeat
+ t := first ts
+ lookup first t = i =>
+ v.i := second t
+ ts := rest ts
+ v
+
+ elt(f,x) ==
+ dot(coordinates f, coordinates x)$Vector(K)
+
+@
+
+
\section{License}
+
<<license>>=
--Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
--All rights reserved.
@@ -541,7 +625,12 @@ LinearElement(K,B): Public == Private where
<<category DIRPCAT DirectProductCategory>>
<<domain DIRPROD DirectProduct>>
<<package DIRPROD2 DirectProductFunctions2>>
+
+<<domain LINBASIS LinearBasis>>
+<<domain DBASIS DualBasis>>
+
<<domain LINELT LinearElement>>
+<<domain LINFORM LinearForm>>
@
\eject