Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
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
abdullh.alsoleman
Front-End
Commits
73eae93b
Commit
73eae93b
authored
Oct 23, 2015
by
Kris Giesing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove inadvertently committed file
parent
739fda1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
75 deletions
+0
-75
lsq_solver_test_disabled.dart
packages/unit/test/gestures/lsq_solver_test_disabled.dart
+0
-75
No files found.
packages/unit/test/gestures/lsq_solver_test_disabled.dart
deleted
100644 → 0
View file @
739fda1a
import
'package:flutter/gestures.dart'
;
import
'package:test/test.dart'
;
void
main
(
)
{
void
printFit
(
PolynomialFit
fit
)
{
print
(
"Confidence: "
+
fit
.
confidence
.
toString
());
for
(
int
i
=
0
;
i
<
fit
.
coefficients
.
length
;
i
++)
print
(
i
.
toString
()
+
": "
+
fit
.
coefficients
[
i
].
toString
());
}
approx
(
double
value
,
double
expectation
)
{
const
double
eps
=
1
e
-
6
;
return
(
value
-
expectation
).
abs
()
<
eps
;
}
test
(
'Least-squares fit: linear polynomial to line'
,
()
{
List
<
double
>
x
=
[
0.0
,
1.0
,
2.0
,
3.0
,
4.0
,
5.0
,
6.0
,
7.0
,
8.0
];
List
<
double
>
y
=
[
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
];
List
<
double
>
w
=
[
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
];
LeastSquaresSolver
solver
=
new
LeastSquaresSolver
(
x
,
y
,
w
);
PolynomialFit
fit
=
solver
.
solve
(
1
);
expect
(
fit
.
coefficients
.
length
,
2
);
expect
(
approx
(
fit
.
coefficients
[
0
],
1.0
),
isTrue
);
expect
(
approx
(
fit
.
coefficients
[
1
],
0.0
),
isTrue
);
expect
(
approx
(
fit
.
confidence
,
1.0
),
isTrue
);
});
test
(
'Least-squares fit: linear polynomial to sloped line'
,
()
{
List
<
double
>
x
=
[
0.0
,
1.0
,
2.0
,
3.0
,
4.0
,
5.0
,
6.0
,
7.0
,
8.0
];
List
<
double
>
y
=
[
1.0
,
2.0
,
3.0
,
4.0
,
5.0
,
6.0
,
7.0
,
8.0
,
9.0
];
List
<
double
>
w
=
[
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
];
LeastSquaresSolver
solver
=
new
LeastSquaresSolver
(
x
,
y
,
w
);
PolynomialFit
fit
=
solver
.
solve
(
1
);
expect
(
fit
.
coefficients
.
length
,
2
);
expect
(
approx
(
fit
.
coefficients
[
0
],
1.0
),
isTrue
);
expect
(
approx
(
fit
.
coefficients
[
1
],
1.0
),
isTrue
);
expect
(
approx
(
fit
.
confidence
,
1.0
),
isTrue
);
});
test
(
'Least-squares fit: quadratic polynomial to line'
,
()
{
List
<
double
>
x
=
[
0.0
,
1.0
,
2.0
,
3.0
,
4.0
,
5.0
,
6.0
,
7.0
,
8.0
];
List
<
double
>
y
=
[
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
];
List
<
double
>
w
=
[
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
];
LeastSquaresSolver
solver
=
new
LeastSquaresSolver
(
x
,
y
,
w
);
PolynomialFit
fit
=
solver
.
solve
(
2
);
expect
(
fit
.
coefficients
.
length
,
3
);
expect
(
approx
(
fit
.
coefficients
[
0
],
1.0
),
isTrue
);
expect
(
approx
(
fit
.
coefficients
[
1
],
0.0
),
isTrue
);
expect
(
approx
(
fit
.
coefficients
[
2
],
0.0
),
isTrue
);
expect
(
approx
(
fit
.
confidence
,
1.0
),
isTrue
);
});
test
(
'Least-squares fit: quadratic polynomial to sloped line'
,
()
{
List
<
double
>
x
=
[
0.0
,
1.0
,
2.0
,
3.0
,
4.0
,
5.0
,
6.0
,
7.0
,
8.0
];
List
<
double
>
y
=
[
1.0
,
2.0
,
3.0
,
4.0
,
5.0
,
6.0
,
7.0
,
8.0
,
9.0
];
List
<
double
>
w
=
[
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
1.0
];
LeastSquaresSolver
solver
=
new
LeastSquaresSolver
(
x
,
y
,
w
);
PolynomialFit
fit
=
solver
.
solve
(
2
);
expect
(
fit
.
coefficients
.
length
,
3
);
expect
(
approx
(
fit
.
coefficients
[
0
],
1.0
),
isTrue
);
expect
(
approx
(
fit
.
coefficients
[
1
],
1.0
),
isTrue
);
expect
(
approx
(
fit
.
coefficients
[
2
],
0.0
),
isTrue
);
expect
(
approx
(
fit
.
confidence
,
1.0
),
isTrue
);
});
}
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