-
Notifications
You must be signed in to change notification settings - Fork 1
frontend Skeleton #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: jhipster-stack-switch
Are you sure you want to change the base?
Changes from all commits
725ddf7
b9729b1
a4af771
c16dbac
accf8ba
fb02607
147642e
f6555d2
b934251
24c5dff
5a25c10
5e27c38
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package com.pri.cabzza.web.rest; | ||
|
|
||
| import com.codahale.metrics.annotation.Timed; | ||
|
|
||
| import java.math.BigDecimal; | ||
|
|
||
| import org.ojalgo.finance.portfolio.MarkowitzModel; | ||
| import org.ojalgo.matrix.BasicMatrix; | ||
| import org.ojalgo.matrix.PrimitiveMatrix; | ||
|
|
||
| import org.springframework.http.MediaType; | ||
| import org.springframework.web.bind.annotation.*; | ||
|
|
||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pls group imports here |
||
| /** | ||
| * REST controller for managing Calculation. | ||
| */ | ||
| @RestController | ||
| @RequestMapping("/api") | ||
| public class CalculateResource { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. name of this class should follow Controller naming convention. f.e. CalculationController |
||
|
|
||
| /** | ||
| * PUT /calculate/:id - calculating NewStockWallet mathematical values and related PortfolioStores | ||
| */ | ||
| @RequestMapping(value = "/calculate", | ||
| method = RequestMethod.PUT, | ||
| produces = MediaType.APPLICATION_JSON_VALUE) | ||
| @Timed | ||
| public void calculate() throws Exception { | ||
|
|
||
| //just testing MarkovitzModel, will be change in the future | ||
| double[][] CArray = {{1.,0.,0.},{0.,0.5,0.},{0.,0.,1.}}; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all these variables could be final
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these variables could be final |
||
| double[][] RArray = {{1,0,-1}}; | ||
| BasicMatrix <Double> covariance = PrimitiveMatrix.FACTORY.rows(CArray); | ||
| BasicMatrix <Double> returns = PrimitiveMatrix.FACTORY.rows(RArray); | ||
| MarkowitzModel currentModel = new MarkowitzModel(covariance,returns); | ||
| currentModel.setShortingAllowed(false); | ||
| currentModel.setTargetReturn(BigDecimal.ZERO); | ||
| System.out.print(currentModel.getWeights()); | ||
|
|
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you are adding a dependency to package.json, do not include files assosiated with this dependecy. It should be downloaded by npm and should not be in the repository