Skip to content

Instantly share code, notes, and snippets.

View pubudu91's full-sized avatar

Pubudu Fernando pubudu91

View GitHub Profile
void blasL1(Matrix1D *A, Matrix1D *B, Matrix1D *C, int n) {
double *Cmat = C->matrix;
double *Amat = A->matrix;
double *Bmat = B->matrix;
double *Arv, *Crv;
omp_set_num_threads(4);
#pragma omp parallel for
for (int i = 0; i < n; ++i) {
void multiply1DMatrixIKJ(Matrix1D *A, Matrix1D *B, Matrix1D *C, int n) {
for (int i = 0; i < n; ++i) {
double *Arow = &A->matrix[i * n];
double *Crow = &C->matrix[i * n];
for (int k = 0; k < n; ++k) {
double temp = *(Arow + k);
double *Brow = &B->matrix[k * n];
for (int j = 0; j < n; ++j)
void parallelMultiply1D(Matrix1D *A, Matrix1D *B, Matrix1D *C, int n) {
omp_set_num_threads(4);
#pragma omp parallel for
for (int i = 0; i < n; ++i) {
double *Arow = &A->matrix[i * n];
double *Crow = &C->matrix[i * n];
for (int j = 0; j < n; ++j) {
double sum = 0;
void multiply1D(Matrix1D *A, Matrix1D *B, Matrix1D *C, int n) {
for (int i = 0; i < n; ++i) {
double *Arow = &A->matrix[i * n];
double *Crow = &C->matrix[i * n];
for (int j = 0; j < n; ++j) {
double sum = 0;
for (int k = 0; k < n; ++k)
sum += *(Arow + k) * B->matrix[k * n + j];
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
for (int k = 0; k < n; k++)
C[i][j] += A[i][k] * B[k][j];
public class Q4 {
public final static int PIZZA_SLICE = 1; // One piece of pizza
public final static int PIZZA_REORDER = 0; // Pizza finished. Signals to reorder
public final static int PIZZA_FINISHED = -1; // Pizza finished
public static void main(String[] args) {
Plate pizzaPlate = new Plate(new Pizza()); // Create a plate to hold the pizza
Runnable[] students = new Runnable[15];
// Runnable implementation for a pizza order
swagger: '2.0'
info:
version: "1.6"
title: "Docker Registry HTTP API"
# Describe your paths here
paths:
# This is a path endpoint.
/v2:
@startuml
#Defining my integration flow
myIntegrationFlow as IntegrationFlow
//This is a sample inbound endpoint
sampleHTTPinbound as InboundEndpoint(protocol("http"),port(8290),context("/sample/request"))
samplePipeline as Pipeline("message_flow_1")
################################################################################
# Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@pubudu91
pubudu91 / greg.conf
Last active February 3, 2016 06:35
Nginx configuration file for WSO2 GReg cluster
upstream publisherhttp{
ip_hash;
server <ip-address-publisher1>:9763;
server <ip-address-publisher2>:9763;
}
upstream publisherhttps{
ip_hash;
server <ip-address-publisher1>:9443;