Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

few modifications

  • Loading branch information...
commit 66b603e4f26a9c58e7bcd7b870839df5b85d7787 1 parent 2cce0b2
@fibo authored
Showing with 24 additions and 3 deletions.
  1. +8 −0 lib/Field.js
  2. +4 −0 lib/Real/VectorSpace.js
  3. +12 −3 lib/util/is.js
View
8 lib/Field.js
@@ -9,6 +9,8 @@ function Field(arg) {
util.inherits(Field, Group);
+//-----------------------------------------------------------------------------
+
Field.prototype.inv = function (element) {
try {
var element = this.coerceToElement(element);
@@ -17,6 +19,8 @@ Field.prototype.inv = function (element) {
catch (err) {}
};
+//-----------------------------------------------------------------------------
+
Field.prototype.mul = function (element1, element2) {
try {
var element1 = this.coerceToElement(element1);
@@ -25,6 +29,8 @@ Field.prototype.mul = function (element1, element2) {
catch (err) {}
};
+//-----------------------------------------------------------------------------
+
Field.prototype.div = function (element1, element2) {
try {
var element1 = this.coerceToElement(element1);
@@ -33,6 +39,8 @@ Field.prototype.div = function (element1, element2) {
catch (err) {}
};
+//-----------------------------------------------------------------------------
+
Field.prototype.getOne = function () {
// TODO throw Error (unimplemented abstract function
};
View
4 lib/Real/VectorSpace.js
@@ -40,7 +40,11 @@ function RealVectorSpace(dim) {
};
+//-----------------------------------------------------------------------------
+
util.inherits(RealVectorSpace, VectorSpace);
+//-----------------------------------------------------------------------------
+
module.exports = RealVectorSpace;
View
15 lib/util/is.js
@@ -1,13 +1,22 @@
var is = {};
-function isDefined(arg) {
- if (arguments.lenght != 1) throw new Error();
+//-----------------------------------------------------------------------------
+function isUndefined() {
return typeof arguments[0] === 'undefined';
}
-is.defined = isDefined;
+is.undef = isUndefined;
+//-----------------------------------------------------------------------------
+
+function isNumber() {
+ return typeof arguments[0] === 'number';
+}
+
+is.number = isNumber;
+
+//-----------------------------------------------------------------------------
module.exports = is;
Please sign in to comment.
Something went wrong with that request. Please try again.