This idea assumes that we already have expression templates implemented via Boost.YAP.
Let's assume user writes following snippets of code using our expression template BLAS library :
Tensor a = {{1,1}, {1,1}, {1,1}};
[START][2021-09-23 03:33:35] LSP logging initiated | |
[START][2021-09-23 03:42:20] LSP logging initiated | |
[START][2021-09-23 03:42:58] LSP logging initiated | |
[INFO][2021-09-23 03:43:00] .../lua/vim/lsp.lua:1216 "exit_handler" {} | |
[START][2021-09-23 03:43:17] LSP logging initiated | |
[INFO][2021-09-23 03:43:21] .../vim/lsp/rpc.lua:316 "Starting RPC client" { args = {}, cmd = "metals", extra = {}} | |
[DEBUG][2021-09-23 03:43:21] .../vim/lsp/rpc.lua:395 "rpc.send" { id = 1, jsonrpc = "2.0", method = "initialize", params = { capabilities = { callHierarchy = { dynamicRegistration = false }, textDocument = { codeAction = { codeActionLiteralSupport = { codeActionKind = { valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } } }, |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <queue> | |
#include <stack> | |
using namespace std; | |
// X raise to the power n, if n is double. | |
double myPow(double x, int n) |
#include <algorithm> | |
#include <vector> | |
// ******************** EXPONENTS AND POWERS ******************** | |
// Returns value of x raised to y | |
int power(int x, unsigned int y) { | |
int res = 1; | |
while (y > 0) { | |
if (y & 1) res = res * x; | |
y = y >> 1; |
#include <algorithm> | |
#include <iostream> | |
#include <type_traits> | |
#include <vector> | |
template <class T> | |
class LinkedList { | |
private: | |
struct Node { | |
Node(T v) : val(v) { |
struct apply_distributive_law { | |
constexpr apply_distributive_law() = default; | |
template <class Expr1, class Expr2> | |
constexpr decltype(auto) | |
operator()(boost::yap::expr_tag<boost::yap::expr_kind::plus>, Expr1 &&e1, | |
Expr2 &&e2) { | |
// We check if the left and right operands of + is a multiply expression. | |
// This returns true if expression is of form of multiply of ublas operands. |
#include <boost/yap/expression.hpp> | |
#include <algorithm> | |
#include <cassert> | |
#include <iostream> | |
#include <vector> | |
// TAKEN FROM BOOST.YAP EXAMPLES, BUT MODIFIED BY CODER3101 | |
/* |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#include <syslog.h> | |
#include <string.h> | |
#include <sys/inotify.h> |
#include <iostream> | |
#define Its int | |
#define most main | |
#define readable ( | |
#define And ) | |
#define deep { | |
#define cplusplus i | |
#define code =0 | |
#define Why for |
#include <stdio.h> | |
#include <sys/socket.h> | |
#include <stdlib.h> | |
#include <netinet/in.h> | |
#include <string.h> | |
#define PORT 12345 | |
#define IP_ADDR_SERVER "192.168.43.51" //YOU MAY NEED TO CHANGE THIS ADDRESS | |
int main(){ | |
struct sockaddr_in address; |