Permalink
Browse files

added separators

  • Loading branch information...
1 parent 1409740 commit 03a6d0f3cee15a72154c6cb35a6fd15c0c9b233d @fibo committed Mar 16, 2013
Showing with 16 additions and 11 deletions.
  1. +5 −1 lib/Real/Element.js
  2. +2 −1 lib/Real/Field.js
  3. +3 −1 lib/Real/Vector.js
  4. +3 −1 lib/Real/VectorSpace.js
  5. +3 −2 lib/Vector.js
  6. +0 −5 test/Real/Vector.js
View
@@ -8,6 +8,8 @@ var InvalidArgumentsException = require('../Exception/InvalidArguments.js');
function RealElement() {
var self = this;
+//-----------------------------------------------------------------------------
+
RingElement.call(self, arguments);
//-----------------------------------------------------------------------------
@@ -167,9 +169,11 @@ function RealElement() {
util.inherits(RealElement, RingElement);
-RealElement.prototype.clone = function () {
+function clone() {
return new RealElement(this.num());
};
+RealElement.prototype.clone = clone;
+
module.exports = RealElement;
View
@@ -1,8 +1,9 @@
var util = require('util');
-var Field = require('../Field.js');
+var Field = require('../Field.js');
var RealElement = require('./Element.js');
+
var coerce = require('../util/coerce.js');
function RealField() {
View
@@ -8,7 +8,9 @@ var coerce = require('../util/coerce.js');
function RealVector(arg) {
var self = this;
- // Coerce elements to Real
+//-----------------------------------------------------------------------------
+
+ // Coerce elements to RealElement.
var elements = [];
for(var i in arg.elements) {
var element = arg.elements[i];
@@ -2,7 +2,7 @@
var util = require('util');
var RealElement = require('./Element.js');
-var RealField = require('./Field.js');
+var RealField = require('./Field.js');
var RealVector = require('./Vector.js');
var VectorSpace = require('../VectorSpace.js');
@@ -11,6 +11,8 @@ var R = new RealField();
function RealVectorSpace(dim) {
var self = this;
+//-----------------------------------------------------------------------------
+
var arg = {};
arg.dim = dim;
View
@@ -22,7 +22,7 @@ function Vector(arg) {
//-----------------------------------------------------------------------------
- function eq(vector) {
+ function equals(vector) {
result = true;
for (var i in self.getElements()) {
@@ -34,7 +34,8 @@ function Vector(arg) {
return result;
};
- self.eq = eq; // TODO equals
+ self.eq = equals;
+ self.eq = eq;
//-----------------------------------------------------------------------------
View
@@ -64,11 +64,6 @@ describe('RealVector', function () {
});
});
- describe('eq(<Vector>)', function () {
- it('...', function () {
- });
- });
-
describe('getElements()', function () {
it('returns the vector elements', function () {
var vector = new R3.Vector(zero, 1, 2);

0 comments on commit 03a6d0f

Please sign in to comment.