LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
sage_rest_engine.h File Reference

SymEngine backed by the line-sage-rest service. More...

#include <cmath>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <mutex>
#include <string>
#include <vector>
#include "json.hpp"
#include "line/api/sym/sym_engine.h"
#include "line/util/error.h"
#include "line/util/http.h"
Include dependency graph for sage_rest_engine.h:

Go to the source code of this file.

Classes

class  line::sym::SageRestEngine
 Client of the line-sage-rest service. More...

Namespaces

namespace  line
namespace  line::sym

Detailed Description

SymEngine backed by the line-sage-rest service.

Port of jline.api.sym.SageRestEngine. The service is SageMath behind the JSON protocol in io/sage/server.py. Every request is a single POST carrying the whole problem, so nothing is bind-mounted and the client works against a container, a remote host or a hand-started server alike.

NUMERIC COEFFICIENTS ARE SENT AS DECIMAL STRINGS and read server side as exact rationals, which is what keeps the solve exact: a double coerced by the CAS would carry the binary rational nearest the decimal instead, and the difference survives all the way into the printed normal form. The same rule applies to the assignment eval() sends.

The server enforces the timeout too, so a runaway symbolic solve is killed there rather than merely abandoned here.

Definition in file sage_rest_engine.h.