Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MatrixCalculator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
maikov
MatrixCalculator
Commits
54cbb974
Commit
54cbb974
authored
2 weeks ago
by
T2heJada
Browse files
Options
Downloads
Patches
Plain Diff
Parse töötab nüüd õigesti astendamisega
parent
44414566
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/ee/ut/cs/gitlab/maikov/expressions/Expression.java
+7
-10
7 additions, 10 deletions
...n/java/ee/ut/cs/gitlab/maikov/expressions/Expression.java
with
7 additions
and
10 deletions
src/main/java/ee/ut/cs/gitlab/maikov/expressions/Expression.java
+
7
−
10
View file @
54cbb974
...
@@ -94,16 +94,13 @@ public abstract class Expression {
...
@@ -94,16 +94,13 @@ public abstract class Expression {
if
(
V_index
<=
0
){
if
(
V_index
<=
0
){
throw
new
TõlgendamatuSisend
(
"Tehe "
+
tehe
+
" vajab kahte muutujat!"
);
throw
new
TõlgendamatuSisend
(
"Tehe "
+
tehe
+
" vajab kahte muutujat!"
);
}
}
Number
tehtetüüp
=
(
Number
)
vasak
.
get
(
V_index
).
compute
();
Expression
baas
=
vasak
.
get
(
V_index
-
1
);
Expression
baas
=
vasak
.
get
(
V_index
-
1
);
if
(
tehtetüüp
.
getNumber
()
==
-
1
)
{
vasak
.
set
(
V_index
-
1
,
vasak
.
set
(
V_index
-
1
,
new
MatrixInversion
(
baas
));
new
Exponentiation
(
baas
,
vasak
.
get
(
V_index
)));
}
else
if
(
tehtetüüp
.
getNumber
()
==
-
2
)
{
vasak
.
set
(
V_index
-
1
,
new
MatrixTranspose
(
baas
));
}
else
{
// Proovitakse ^2 või midagi
throw
new
InvalidOperandException
(
"'^' järel peab olema 'T' või '-1'!"
);
}
tehted
.
remove
(
T_index
);
tehted
.
remove
(
T_index
);
vasak
.
remove
(
V_index
--);
vasak
.
remove
(
V_index
--);
}
else
if
(
"+-*/"
.
contains
(
tehe
))
{
}
else
if
(
"+-*/"
.
contains
(
tehe
))
{
...
@@ -232,7 +229,7 @@ public abstract class Expression {
...
@@ -232,7 +229,7 @@ public abstract class Expression {
if
(
tehted
.
size
()
>
0
if
(
tehted
.
size
()
>
0
&&
lekseem
.
equals
(
"T"
)
// Transponeerimine
&&
lekseem
.
equals
(
"T"
)
// Transponeerimine
&&
tehted
.
get
(
tehted
.
size
()
-
1
).
equals
(
"^"
))
{
&&
tehted
.
get
(
tehted
.
size
()
-
1
).
equals
(
"^"
))
{
vasak
.
add
(
new
Number
(
-
2
));
// Sümboliseerib transp.
vasak
.
add
(
new
Number
(
Double
.
NaN
));
// Sümboliseerib transp.
}
else
if
(
liikmed
.
containsKey
(
lekseem
))
{
}
else
if
(
liikmed
.
containsKey
(
lekseem
))
{
vasak
.
add
(
liikmed
.
get
(
lekseem
).
clone
());
vasak
.
add
(
liikmed
.
get
(
lekseem
).
clone
());
}
else
{
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment