Added more files from OOP prototype into the repository trunk.
[openmx:openmx.git] / R / MxAlgebra.R
1 setConstructorS3("MxAlgebra", function(formula) {
2
3   if (missing(formula)) formula <- NA;
4   formula <- match.call()$formula;
5
6   extend(Object(), "MxAlgebra",
7         .formula=formula,
8         .translation=NULL,
9         .dirty=TRUE
10   );
11
12 })
13
14 setMethodS3("print", "MxAlgebra", function(x, ...) {
15    cat("Formula: ")
16    print(x$.formula)
17    cat("Translation: ")
18    print(x$.translation)
19    cat("Dirty:", x$.dirty, "\n")
20    invisible(x)
21 })