forked from natikgadzhi/XNMaths
-
Notifications
You must be signed in to change notification settings - Fork 1
/
XNMatrix.h
67 lines (50 loc) · 1.71 KB
/
XNMatrix.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//
// XNMatrix.h
// Assignation 3.2
//
// XNMatrix class
// A Matrix of ids.
//
// Created by Нат Гаджибалаев on 15.11.09.
// Copyright 2009 Нат Гаджибалаев. All rights reserved.
//
#pragma mark -
#pragma mark Imports
#import <Cocoa/Cocoa.h>
@class XNVector;
#pragma mark -
#pragma mark XNMatrix class interface
@interface XNMatrix : NSObject {
NSUInteger rowsCount, columnsCount;
CGFloat *data;
}
@property NSUInteger rowsCount, columnsCount;
#pragma mark -
#pragma mark Class init methods
- (XNMatrix *) matrixWithRows: (NSUInteger) newRowsCount columns: (NSUInteger) newColumnsCount;
- (XNMatrix *) matrixWithRows: (NSUInteger) newRowsCount columns: (NSUInteger) newColumnsCount filledWith: ( CGFloat *) newCArray;
#pragma mark -
#pragma mark Initialization methods.
- (XNMatrix *) initWithRows: (NSUInteger) newRowsCount columns: (NSUInteger) newColumnsCount;
- (XNMatrix *) initWithRows: (NSUInteger) newRowsCount columns: (NSUInteger) newColumnsCount filledWith: ( CGFloat *) newCArray;
#pragma mark -
#pragma mark Object mgmt
- (XNMatrix *) copy;
#pragma mark -
#pragma mark Accessor methods
- (CGFloat) valueAtRow: (NSUInteger)row column: (NSUInteger)column;
- (void) setValue: (CGFloat)value atRow: (NSUInteger)row column: (NSUInteger)column;
#pragma mark -
#pragma mark Access columns and rows
- (XNVector *) columnVectorAtIndex: (NSUInteger) index;
- (XNVector *) rowVectorAtIndex: (NSUInteger) index;
- (XNVector *) multiplyByVector: (XNVector *) vector;
- (void) removeColumnAtIndex: (NSUInteger) index;
- (void) removeRowAtIndex: (NSUInteger) index;
#pragma mark -
#pragma mark Matrix properties
- (BOOL) isSquare;
#pragma mark -
#pragma mark Debugging
- (void) printToLog;
@end