Copyright | (c) Masahiro Sakai 20122016 |
---|---|
License | BSD-style |
Maintainer | masahiro.sakai@gmail.com |
Stability | provisional |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
References:
- SDPA (Semidefinite Programming Algorithm) User's Manual http://sdpa.indsys.chuo-u.ac.jp/~fujisawa/sdpa_doc.pdf
- http://euler.nmt.edu/~brian/sdplib/FORMAT
- data Problem = Problem {
- blockStruct :: [Int]
- costs :: [Scientific]
- matrices :: [Matrix]
- type Matrix = [Block]
- type Block = Map (Int, Int) Scientific
- mDim :: Problem -> Int
- nBlock :: Problem -> Int
- blockElem :: Int -> Int -> Block -> Scientific
- type DenseMatrix = [DenseBlock]
- type DenseBlock = [[Scientific]]
- denseMatrix :: DenseMatrix -> Matrix
- denseBlock :: DenseBlock -> Block
- diagBlock :: [Scientific] -> Block
- render :: Problem -> Builder
- renderSparse :: Problem -> Builder
- type ParseError = ParseError Word8 Void
- parseData :: String -> ByteString -> Either ParseError Problem
- parseDataFile :: FilePath -> IO (Either ParseError Problem)
- parseSparseData :: String -> ByteString -> Either ParseError Problem
- parseSparseDataFile :: FilePath -> IO (Either ParseError Problem)
The problem type
Problem | |
|
Construction
type DenseMatrix = [DenseBlock] Source #
type DenseBlock = [[Scientific]] Source #
denseMatrix :: DenseMatrix -> Matrix Source #
denseBlock :: DenseBlock -> Block Source #
diagBlock :: [Scientific] -> Block Source #
Rendering
renderSparse :: Problem -> Builder Source #
Parsing
type ParseError = ParseError Word8 Void Source #
parseData :: String -> ByteString -> Either ParseError Problem Source #
Parse a SDPA format (.dat) string.
parseDataFile :: FilePath -> IO (Either ParseError Problem) Source #
Parse a SDPA format file (.dat).
parseSparseData :: String -> ByteString -> Either ParseError Problem Source #
Parse a SDPA sparse format (.dat-s) string.
parseSparseDataFile :: FilePath -> IO (Either ParseError Problem) Source #
Parse a SDPA sparse format file (.dat-s).