Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
motosat
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
motosat
Commits
56ca0c83
Commit
56ca0c83
authored
Sep 10, 2019
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dding polinomial approximation 2d
parent
6c5510bb
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
273 additions
and
1 deletion
+273
-1
Matrix.php
Matrix.php
+23
-0
PolynomialApproximation.php
PolynomialApproximation.php
+250
-1
No files found.
Matrix.php
View file @
56ca0c83
...
...
@@ -23,6 +23,11 @@ class Matrix
return
$this
->
M
;
}
public
function
set
(
$i
,
$j
,
$v
){
$M
[
$i
][
$j
]
=
$v
;
}
public
function
getColumnPackedCopy
(){
$rows
=
sizeof
(
$this
->
M
);
$cols
=
sizeof
(
$this
->
M
[
0
]);
...
...
@@ -82,6 +87,9 @@ class Matrix
}
public
function
plus
(
$B
)
{
if
(
$B
instanceof
Matrix
){
$B
=
$B
->
get
();
}
$R
=
$this
->
M
;
$rows
=
sizeof
(
$this
->
M
);
$cols
=
sizeof
(
$this
->
M
[
0
]);
...
...
@@ -95,6 +103,21 @@ class Matrix
}
return
new
Matrix
(
$R
,
$this
->
Tol
);
}
public
function
plusEquals
(
$B
){
if
(
$B
instanceof
Matrix
){
$B
=
$B
->
get
();
}
$rows
=
sizeof
(
$this
->
M
);
$cols
=
sizeof
(
$this
->
M
[
0
]);
if
((
$rows
!=
sizeof
(
$B
[
0
]))
||
(
$cols
!=
sizeof
(
$B
[
0
]))){
throw
new
Exception
(
'Dimensions mismatch.'
);
}
for
(
$i
=
0
;
$i
<
$rows
;
$i
++
)
{
for
(
$j
=
0
;
$j
<
$cols
;
$j
++
)
{
$this
->
M
[
$i
][
$j
]
+=
$B
[
$i
][
$j
];
}
}
}
public
function
print
(
$debugFile
=
null
,
$decimals
=
6
)
...
...
PolynomialApproximation.php
View file @
56ca0c83
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment