query
stringlengths 7
3.85k
| document
stringlengths 11
430k
| metadata
dict | negatives
sequencelengths 0
101
| negative_scores
sequencelengths 0
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
pubSubClient returns an authenticated Google PubSub client instance. | func pubSubClient(ctx context.Context, cloudProject string) (*pubsub.Client, error) {
ts, err := auth.GetTokenSource(ctx, auth.AsSelf, auth.WithScopes(auth.CloudOAuthScopes...))
if err != nil {
return nil, errors.Annotate(err, "failed to get the token source").Err()
}
client, err := pubsub.NewClient(ctx, cloudProject, option.WithTokenSource(ts))
if err != nil {
return nil, errors.Annotate(err, "failed to create the PubSub client").Err()
}
return client, nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func NewPubSubClient(projectID string) (*pubsub.Client, *context.Context, error) {\n\tctx := context.Background()\n\tclient, err := pubsub.NewClient(ctx, projectID)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn client, &ctx, nil\n}",
"func NewClient(ctx context.Context, projectID string, sensor instana.TracerLogger, opts ...option.ClientOption) (*Client, error) {\n\tc, err := pubsub.NewClient(ctx, projectID, opts...)\n\treturn &Client{c, projectID, sensor}, err\n}",
"func NewClient(ctx context.Context, projectID, topic string, opts ...ClientOption) (*Client, error) {\n\tc, err := pubsub.NewClient(ctx, projectID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient := &Client{\n\t\tclient: c,\n\t\ttopic: c.Topic(topic),\n\t\tencode: json.Marshal,\n\t}\n\tfor _, opt := range opts {\n\t\topt(client)\n\t}\n\treturn client, nil\n}",
"func newClient(project string) (*client, error) {\n\tctx := context.Background()\n\tcl, err := pubsub.NewClient(ctx, project)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &client{\n\t\tclient: cl,\n\t}, nil\n}",
"func NewClient(ctx context.Context, opts *PoolOptions) (SubClient, error) {\n\tpool, err := newPool(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsubMngr := newSubscriptionManager(pool, &PubSubOpts{\n\t\tPingInterval: 5 * time.Second,\n\t\tReadTimeout: opts.ReadTimeout,\n\t\tInitBufSize: opts.InitialBufSize,\n\t})\n\treturn &client{\n\t\tpool: pool,\n\t\tpoolOpts: opts,\n\t\tsubMngr: subMngr,\n\t}, nil\n}",
"func NewClient(client *pubsub.Client) *Client {\n\treturn (*Client)(client)\n}",
"func NewGooglePubSub(projectID string) (*GooglePubSub, error) {\n\tgoogleCredsEnvVar := os.Getenv(googleCredsEnvVarName)\n\temulatorEnvVar := os.Getenv(googleEmulatorEnvVarName)\n\tif googleCredsEnvVar == \"\" && emulatorEnvVar == \"\" {\n\t\treturn nil, errors.New(\"Required Google envvars do not appear to be set\")\n\t}\n\tclient, ctx, err := NewPubSubClient(projectID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &GooglePubSub{\n\t\tprojectID: projectID,\n\t\tclient: client,\n\t\tctx: *ctx,\n\t}, nil\n}",
"func New(ctx context.Context, googleCloudConfig *googlecloud.Config, pubsubConfig *PubSub) *Service {\n\tplan, err := json.Marshal(googleCloudConfig)\n\tif err != nil {\n\t\tlogger.Warnf(\"error while read config file: %s\", err)\n\t}\n\n\tclient, err := pubsub.NewClient(ctx, googleCloudConfig.ProjectId, option.WithCredentialsJSON(plan))\n\tif err != nil {\n\t\tlogger.Warnf(\"error while create google cloud pubsub client: %s\", err)\n\t}\n\n\treturn &Service{\n\t\tConfig: pubsubConfig,\n\t\tClient: client,\n\t\tContext: ctx,\n\t}\n}",
"func ProvideSubsClient(deps BaseDependencies, e endpoints.Endpoints) (s PubSubTransport, err error) {\n\tlg := log.New(\"PubSub\", deps.Sample.Log)\n\tctx := context.Background()\n\tsubClnt := transport.NewSubClient(deps.Sample.PS.SubURL, lg, e) // Create Sub client to listen for events\n\n\ts = PubSubTransport{\n\t\tEnabled: true,\n\t\tStart: func() error {\n\t\t\t// Start PubSub Client\n\t\t\tif deps.Sample.PS.Enabled {\n\t\t\t\tlg.Debugw(ctx, \"msg\", \"Listening on pubsub %s\", deps.Sample.PS.SubURL)\n\t\t\t\treturn subClnt.Receive()\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t\tShutdown: func() {\n\t\t\tif subClnt.Subscription != nil {\n\t\t\t\tlg.Debugw(ctx, \"Closing pubsub\")\n\t\t\t\tsubClnt.Subscription.Shutdown(context.Background())\n\t\t\t}\n\t\t},\n\t}\n\treturn s, err\n}",
"func ExampleClient_Get() {\n\tcred, err := azidentity.NewDefaultAzureCredential(nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n\t}\n\tctx := context.Background()\n\tclientFactory, err := armwebpubsub.NewClientFactory(\"<subscription-id>\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tres, err := clientFactory.NewClient().Get(ctx, \"myResourceGroup\", \"myWebPubSubService\", nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to finish the request: %v\", err)\n\t}\n\t// You could use response here. We use blank identifier for just demo purposes.\n\t_ = res\n\t// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t// res.ResourceInfo = armwebpubsub.ResourceInfo{\n\t// \tName: to.Ptr(\"myWebPubSubService\"),\n\t// \tType: to.Ptr(\"Microsoft.SignalRService/WebPubSub\"),\n\t// \tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService\"),\n\t// \tSystemData: &armwebpubsub.SystemData{\n\t// \t\tCreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2015-02-03T04:05:06Z\"); return t}()),\n\t// \t\tCreatedBy: to.Ptr(\"string\"),\n\t// \t\tCreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser),\n\t// \t\tLastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2015-02-03T04:05:06Z\"); return t}()),\n\t// \t\tLastModifiedBy: to.Ptr(\"string\"),\n\t// \t\tLastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser),\n\t// \t},\n\t// \tLocation: to.Ptr(\"eastus\"),\n\t// \tTags: map[string]*string{\n\t// \t\t\"key1\": to.Ptr(\"value1\"),\n\t// \t},\n\t// \tIdentity: &armwebpubsub.ManagedIdentity{\n\t// \t\tType: to.Ptr(armwebpubsub.ManagedIdentityTypeSystemAssigned),\n\t// \t\tPrincipalID: to.Ptr(\"00000000-0000-0000-0000-000000000000\"),\n\t// \t\tTenantID: to.Ptr(\"00000000-0000-0000-0000-000000000000\"),\n\t// \t},\n\t// \tKind: to.Ptr(armwebpubsub.ServiceKindWebPubSub),\n\t// \tProperties: &armwebpubsub.Properties{\n\t// \t\tDisableAADAuth: to.Ptr(false),\n\t// \t\tDisableLocalAuth: to.Ptr(false),\n\t// \t\tExternalIP: to.Ptr(\"10.0.0.1\"),\n\t// \t\tHostName: to.Ptr(\"mywebpubsubservice.webpubsub.azure.com\"),\n\t// \t\tLiveTraceConfiguration: &armwebpubsub.LiveTraceConfiguration{\n\t// \t\t\tCategories: []*armwebpubsub.LiveTraceCategory{\n\t// \t\t\t\t{\n\t// \t\t\t\t\tName: to.Ptr(\"ConnectivityLogs\"),\n\t// \t\t\t\t\tEnabled: to.Ptr(\"true\"),\n\t// \t\t\t}},\n\t// \t\t\tEnabled: to.Ptr(\"false\"),\n\t// \t\t},\n\t// \t\tNetworkACLs: &armwebpubsub.NetworkACLs{\n\t// \t\t\tDefaultAction: to.Ptr(armwebpubsub.ACLActionDeny),\n\t// \t\t\tPrivateEndpoints: []*armwebpubsub.PrivateEndpointACL{\n\t// \t\t\t\t{\n\t// \t\t\t\t\tAllow: []*armwebpubsub.WebPubSubRequestType{\n\t// \t\t\t\t\t\tto.Ptr(armwebpubsub.WebPubSubRequestTypeServerConnection)},\n\t// \t\t\t\t\t\tName: to.Ptr(\"mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e\"),\n\t// \t\t\t\t}},\n\t// \t\t\t\tPublicNetwork: &armwebpubsub.NetworkACL{\n\t// \t\t\t\t\tAllow: []*armwebpubsub.WebPubSubRequestType{\n\t// \t\t\t\t\t\tto.Ptr(armwebpubsub.WebPubSubRequestTypeClientConnection)},\n\t// \t\t\t\t\t},\n\t// \t\t\t\t},\n\t// \t\t\t\tPrivateEndpointConnections: []*armwebpubsub.PrivateEndpointConnection{\n\t// \t\t\t\t\t{\n\t// \t\t\t\t\t\tName: to.Ptr(\"mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e\"),\n\t// \t\t\t\t\t\tType: to.Ptr(\"Microsoft.SignalRService/WebPubSub/privateEndpointConnections\"),\n\t// \t\t\t\t\t\tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/privateEndpointConnections/mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e\"),\n\t// \t\t\t\t\t\tSystemData: &armwebpubsub.SystemData{\n\t// \t\t\t\t\t\t\tCreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2015-02-03T04:05:06Z\"); return t}()),\n\t// \t\t\t\t\t\t\tCreatedBy: to.Ptr(\"string\"),\n\t// \t\t\t\t\t\t\tCreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser),\n\t// \t\t\t\t\t\t\tLastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2015-02-03T04:05:06Z\"); return t}()),\n\t// \t\t\t\t\t\t\tLastModifiedBy: to.Ptr(\"string\"),\n\t// \t\t\t\t\t\t\tLastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser),\n\t// \t\t\t\t\t\t},\n\t// \t\t\t\t\t\tProperties: &armwebpubsub.PrivateEndpointConnectionProperties{\n\t// \t\t\t\t\t\t\tPrivateEndpoint: &armwebpubsub.PrivateEndpoint{\n\t// \t\t\t\t\t\t\t\tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint\"),\n\t// \t\t\t\t\t\t\t},\n\t// \t\t\t\t\t\t\tPrivateLinkServiceConnectionState: &armwebpubsub.PrivateLinkServiceConnectionState{\n\t// \t\t\t\t\t\t\t\tActionsRequired: to.Ptr(\"None\"),\n\t// \t\t\t\t\t\t\t\tStatus: to.Ptr(armwebpubsub.PrivateLinkServiceConnectionStatusApproved),\n\t// \t\t\t\t\t\t\t},\n\t// \t\t\t\t\t\t\tProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded),\n\t// \t\t\t\t\t\t},\n\t// \t\t\t\t}},\n\t// \t\t\t\tProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded),\n\t// \t\t\t\tPublicNetworkAccess: to.Ptr(\"Enabled\"),\n\t// \t\t\t\tPublicPort: to.Ptr[int32](443),\n\t// \t\t\t\tResourceLogConfiguration: &armwebpubsub.ResourceLogConfiguration{\n\t// \t\t\t\t\tCategories: []*armwebpubsub.ResourceLogCategory{\n\t// \t\t\t\t\t\t{\n\t// \t\t\t\t\t\t\tName: to.Ptr(\"ConnectivityLogs\"),\n\t// \t\t\t\t\t\t\tEnabled: to.Ptr(\"true\"),\n\t// \t\t\t\t\t}},\n\t// \t\t\t\t},\n\t// \t\t\t\tServerPort: to.Ptr[int32](443),\n\t// \t\t\t\tTLS: &armwebpubsub.TLSSettings{\n\t// \t\t\t\t\tClientCertEnabled: to.Ptr(true),\n\t// \t\t\t\t},\n\t// \t\t\t\tVersion: to.Ptr(\"1.0\"),\n\t// \t\t\t},\n\t// \t\t\tSKU: &armwebpubsub.ResourceSKU{\n\t// \t\t\t\tName: to.Ptr(\"Premium_P1\"),\n\t// \t\t\t\tCapacity: to.Ptr[int32](1),\n\t// \t\t\t\tSize: to.Ptr(\"P1\"),\n\t// \t\t\t\tTier: to.Ptr(armwebpubsub.WebPubSubSKUTierPremium),\n\t// \t\t\t},\n\t// \t\t}\n}",
"func NewGCPPubSubBroker(opts ...BrokerOptionFunc) *Broker {\n\tdeferFunc := logger.LogWithDefer(\"Load GCP PubSub broker configuration... \")\n\tdefer deferFunc()\n\n\tgcpPubSubBroker := &Broker{}\n\tfor _, opt := range opts {\n\t\topt(gcpPubSubBroker)\n\t}\n\n\tif gcpPubSubBroker.publisher == nil {\n\t\tgcpPubSubBroker.publisher = NewPublisher(gcpPubSubBroker.client)\n\t}\n\n\treturn gcpPubSubBroker\n}",
"func NewPublisherClient(ctx context.Context, opts ...option.ClientOption) (*PublisherClient, error) {\n\tconn, err := transport.DialGRPC(ctx, append(defaultPublisherClientOptions(), opts...)...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc := &PublisherClient{\n\t\tconn: conn,\n\t\tclient: pubsubpb.NewPublisherClient(conn),\n\t\tCallOptions: defaultPublisherCallOptions(),\n\t}\n\tc.SetGoogleClientInfo(\"gax\", gax.Version)\n\treturn c, nil\n}",
"func NewSubAccountClient(client *rest.Client) (*SubAccountClient, error) {\n\treturn &SubAccountClient{\n\t\tclient: client,\n\t}, nil\n}",
"func GetAuthorizedClient() (*http.Client, error) {\n\t// read client secret\n\tbytes, err := ioutil.ReadFile(credentialsPath)\n\tif err != nil {\n\t\treturn nil, errors.New(\"Failed to read credentials: \" + err.Error())\n\t}\n\n\t// initialize config for client authorization\n\tconfig, err := google.ConfigFromJSON(bytes, scope)\n\tif err != nil {\n\t\treturn nil, errors.New(\"Failed to parse config: \" + err.Error())\n\t}\n\n\t// authorize client (OAuth2)\n\treturn authorizeClient(config)\n}",
"func newSecretClient(subID string, authorizer auth.Authorizer) (*client, error) {\n\tc, err := wssdcloudclient.GetSecretClient(&subID, authorizer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &client{c}, nil\n}",
"func NewClient(instanceConfig config.InstanceConfig, apiConfig DestinationServiceAPIConfig,\n\tsubdomain string) (*Client, error) {\n\tif err := setInstanceConfigTokenURLForSubdomain(&instanceConfig, apiConfig, subdomain); err != nil {\n\t\treturn nil, err\n\t}\n\thttpClient, err := getHTTPClient(instanceConfig, apiConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Client{\n\t\tHTTPClient: httpClient,\n\t\tapiConfig: apiConfig,\n\t\tauthConfig: instanceConfig,\n\t}, nil\n}",
"func InitDefaultClient(gcpProjectName, credentialPath string) *pubsub.Client {\n\tclient, err := pubsub.NewClient(context.Background(), gcpProjectName, option.WithCredentialsFile(credentialPath))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn client\n}",
"func newPubSub(t *testing.T, enableMessageOrdering bool, marshaler googlecloud.Marshaler, unmarshaler googlecloud.Unmarshaler, subscriptionName googlecloud.SubscriptionNameFn) (message.Publisher, message.Subscriber) {\n\tlogger := watermill.NewStdLogger(true, true)\n\n\tpublisher, err := googlecloud.NewPublisher(\n\t\tgooglecloud.PublisherConfig{\n\t\t\tEnableMessageOrdering: enableMessageOrdering,\n\t\t\tMarshaler: marshaler,\n\t\t},\n\t\tlogger,\n\t)\n\trequire.NoError(t, err)\n\n\tsubscriber, err := googlecloud.NewSubscriber(\n\t\tgooglecloud.SubscriberConfig{\n\t\t\tGenerateSubscriptionName: subscriptionName,\n\t\t\tSubscriptionConfig: pubsub.SubscriptionConfig{\n\t\t\t\tRetainAckedMessages: false,\n\t\t\t\tEnableMessageOrdering: enableMessageOrdering,\n\t\t\t},\n\t\t\tUnmarshaler: unmarshaler,\n\t\t},\n\t\tlogger,\n\t)\n\trequire.NoError(t, err)\n\n\treturn publisher, subscriber\n}",
"func newClient() (*storage.Client, error) {\n\tctx := context.Background()\n\n\tbyteKey, err := gcloud.GetDecodedKey()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get gcp key, err: %w\", err)\n\t}\n\tclient, err := storage.NewClient(ctx, option.WithCredentialsJSON(byteKey))\n\tif err != nil {\n\t\tlog.Println(\"failed to login with GCP_KEY, trying with default application credentials...\")\n\t\tclient, err = storage.NewClient(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to open Google Cloud Storage client: %w\", err)\n\t\t}\n\t}\n\n\treturn client, nil\n}",
"func (c *Client) NewPubSub() *PubSub {\n\treturn &PubSub{\n\t\tconn: c.pool.Get(),\n\t}\n}",
"func NewClient(c Config) (*Client, error) {\n\tif c.CookieName == \"\" {\n\t\treturn nil, fmt.Errorf(\"must supply a cookie name\")\n\t}\n\tif c.Regexp == \"\" {\n\t\tc.Regexp = noMatch\n\t}\n\n\thasEmailScope := false\n\n\tfor _, s := range c.Scopes {\n\t\tif s == emailScope {\n\t\t\thasEmailScope = true\n\t\t}\n\t}\n\tif !hasEmailScope {\n\t\tc.Scopes = append(c.Scopes, \"https://www.googleapis.com/auth/userinfo.email\")\n\t}\n\n\tmatch, err := regexp.Compile(c.Regexp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\toc := &Client{\n\t\toauthConfig: &oauth2.Config{\n\t\t\tClientID: c.Token,\n\t\t\tClientSecret: c.Secret,\n\t\t\tRedirectURL: c.RedirectURL,\n\t\t\tScopes: c.Scopes,\n\t\t\tEndpoint: google.Endpoint,\n\t\t},\n\t\tsm: sessions.NewManager(c.CookieName),\n\t\tm: map[string]*oauth2.Token{},\n\t\thttpClients: map[string]*http.Client{},\n\t\tmatch: match,\n\t}\n\n\tx := make([]byte, 32)\n\trand.Read(x)\n\toc.oauthState = fmt.Sprintf(\"%x\", x)\n\toc.whitelist = map[string]struct{}{}\n\treturn oc, nil\n}",
"func NewPubSub() *PubSub {\n\tsubs := make(map[int]*Subscription)\n\tps := PubSub{mu: &sync.RWMutex{}, subscriptions: subs, ssid: 0}\n\treturn &ps\n}",
"func New(host string) *PubSub {\n\tps := PubSub{\n\t\thost: host,\n\t}\n\n\t// PRETEND THERE IS A SPECIFIC IMPLEMENTATION.\n\n\treturn &ps\n}",
"func NewAuthClient(settings Settings) Auth {\r\n\ta := Auth{}\r\n\ta.connect(settings.Address)\r\n\treturn a\r\n}",
"func NewGCPPubSubQueue(ctx context.Context, logger logger.Logger, projectID, topicName string) (*GCPPubSubQueue, error) {\n\tq := &GCPPubSubQueue{logger: logger}\n\n\tif projectID == \"\" {\n\t\treturn nil, errors.New(\"projectID must not be empty\")\n\t}\n\n\t// create a context with a timeout for exclusive use of connection setup to\n\t// ensure connnection setup doesn't block and can fail early.\n\tcxnCtx, cancel := context.WithTimeout(ctx, cxnTimeout)\n\tdefer cancel()\n\n\tclient, err := pubsub.NewClient(cxnCtx, projectID)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not create client\")\n\t}\n\n\tif topicName == \"\" {\n\t\ttopicName = defaultTopicName\n\t}\n\ttopicName += \"-v\" + version\n\n\tlogger.Infof(\"creating topic %q\", topicName)\n\tq.topic, err = client.CreateTopic(cxnCtx, topicName)\n\tif code := grpc.Code(err); code != codes.OK && code != codes.AlreadyExists {\n\t\treturn nil, errors.Wrap(err, \"could not create topic\")\n\t}\n\n\tsubName := topicName + \"-\" + defaultSubName\n\n\tlogger.Infof(\"creating subscription %q\", subName)\n\tq.subscription, err = client.CreateSubscription(cxnCtx, subName, pubsub.SubscriptionConfig{\n\t\tTopic: q.topic,\n\t\tAckDeadline: 0,\n\t})\n\tif code := grpc.Code(err); code != codes.OK && code != codes.AlreadyExists {\n\t\treturn nil, errors.Wrap(err, \"could not create subscription\")\n\t}\n\n\tq.subscription.ReceiveSettings.MaxOutstandingMessages = 1 // limit concurrency\n\n\treturn q, nil\n}",
"func newIdentityClient(subID string, authorizer auth.Authorizer) (*client, error) {\n\tc, err := wssdcloudclient.GetIdentityClient(&subID, authorizer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &client{c}, nil\n}",
"func NewGCPPubSub(conf Config, mgr interop.Manager, log log.Modular, stats metrics.Type) (input.Streamed, error) {\n\tvar c reader.Async\n\tvar err error\n\tif c, err = reader.NewGCPPubSub(conf.GCPPubSub, log, stats); err != nil {\n\t\treturn nil, err\n\t}\n\treturn NewAsyncReader(TypeGCPPubSub, true, c, log, stats)\n}",
"func AuthenticatedClient(options gophercloud.AuthOptions) (*gophercloud.ProviderClient, error) {\n\tclient, err := NewClient(options.IdentityEndpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = Authenticate(client, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn client, nil\n}",
"func NewSubscriber(projectID, subscription string) (subscriber *Subscriber, err error) {\n\n\ts := &Subscriber{\n\t\tcontext: context.Background(),\n\t}\n\n\tclient, err := pubsub.NewClient(s.context, projectID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to create client: %v\", err)\n\t}\n\n\ts.client = client\n\ts.sub = s.client.Subscription(subscription)\n\n\treturn s, nil\n\n}",
"func Client(ctx context.Context, projectID string) (internalspb.InternalsClient, error) {\n\tt, err := auth.GetRPCTransport(ctx, auth.AsSelf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn internalspb.NewInternalsClient(\n\t\t&prpc.Client{\n\t\t\tC: &http.Client{Transport: t},\n\t\t\tHost: fmt.Sprintf(\"%s.appspot.com\", projectID),\n\t\t\tOptions: prpc.DefaultOptions(),\n\t\t},\n\t), nil\n}",
"func ExampleClient_BeginCreateOrUpdate() {\n\tcred, err := azidentity.NewDefaultAzureCredential(nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n\t}\n\tctx := context.Background()\n\tclientFactory, err := armwebpubsub.NewClientFactory(\"<subscription-id>\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tpoller, err := clientFactory.NewClient().BeginCreateOrUpdate(ctx, \"myResourceGroup\", \"myWebPubSubService\", armwebpubsub.ResourceInfo{\n\t\tLocation: to.Ptr(\"eastus\"),\n\t\tTags: map[string]*string{\n\t\t\t\"key1\": to.Ptr(\"value1\"),\n\t\t},\n\t\tIdentity: &armwebpubsub.ManagedIdentity{\n\t\t\tType: to.Ptr(armwebpubsub.ManagedIdentityTypeSystemAssigned),\n\t\t},\n\t\tKind: to.Ptr(armwebpubsub.ServiceKindWebPubSub),\n\t\tProperties: &armwebpubsub.Properties{\n\t\t\tDisableAADAuth: to.Ptr(false),\n\t\t\tDisableLocalAuth: to.Ptr(false),\n\t\t\tLiveTraceConfiguration: &armwebpubsub.LiveTraceConfiguration{\n\t\t\t\tCategories: []*armwebpubsub.LiveTraceCategory{\n\t\t\t\t\t{\n\t\t\t\t\t\tName: to.Ptr(\"ConnectivityLogs\"),\n\t\t\t\t\t\tEnabled: to.Ptr(\"true\"),\n\t\t\t\t\t}},\n\t\t\t\tEnabled: to.Ptr(\"false\"),\n\t\t\t},\n\t\t\tNetworkACLs: &armwebpubsub.NetworkACLs{\n\t\t\t\tDefaultAction: to.Ptr(armwebpubsub.ACLActionDeny),\n\t\t\t\tPrivateEndpoints: []*armwebpubsub.PrivateEndpointACL{\n\t\t\t\t\t{\n\t\t\t\t\t\tAllow: []*armwebpubsub.WebPubSubRequestType{\n\t\t\t\t\t\t\tto.Ptr(armwebpubsub.WebPubSubRequestTypeServerConnection)},\n\t\t\t\t\t\tName: to.Ptr(\"mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e\"),\n\t\t\t\t\t}},\n\t\t\t\tPublicNetwork: &armwebpubsub.NetworkACL{\n\t\t\t\t\tAllow: []*armwebpubsub.WebPubSubRequestType{\n\t\t\t\t\t\tto.Ptr(armwebpubsub.WebPubSubRequestTypeClientConnection)},\n\t\t\t\t},\n\t\t\t},\n\t\t\tPublicNetworkAccess: to.Ptr(\"Enabled\"),\n\t\t\tTLS: &armwebpubsub.TLSSettings{\n\t\t\t\tClientCertEnabled: to.Ptr(false),\n\t\t\t},\n\t\t},\n\t\tSKU: &armwebpubsub.ResourceSKU{\n\t\t\tName: to.Ptr(\"Premium_P1\"),\n\t\t\tCapacity: to.Ptr[int32](1),\n\t\t\tTier: to.Ptr(armwebpubsub.WebPubSubSKUTierPremium),\n\t\t},\n\t}, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to finish the request: %v\", err)\n\t}\n\tres, err := poller.PollUntilDone(ctx, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to pull the result: %v\", err)\n\t}\n\t// You could use response here. We use blank identifier for just demo purposes.\n\t_ = res\n\t// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t// res.ResourceInfo = armwebpubsub.ResourceInfo{\n\t// \tName: to.Ptr(\"myWebPubSubService\"),\n\t// \tType: to.Ptr(\"Microsoft.SignalRService/WebPubSub\"),\n\t// \tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService\"),\n\t// \tSystemData: &armwebpubsub.SystemData{\n\t// \t\tCreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2015-02-03T04:05:06Z\"); return t}()),\n\t// \t\tCreatedBy: to.Ptr(\"string\"),\n\t// \t\tCreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser),\n\t// \t\tLastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2015-02-03T04:05:06Z\"); return t}()),\n\t// \t\tLastModifiedBy: to.Ptr(\"string\"),\n\t// \t\tLastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser),\n\t// \t},\n\t// \tLocation: to.Ptr(\"eastus\"),\n\t// \tTags: map[string]*string{\n\t// \t\t\"key1\": to.Ptr(\"value1\"),\n\t// \t},\n\t// \tIdentity: &armwebpubsub.ManagedIdentity{\n\t// \t\tType: to.Ptr(armwebpubsub.ManagedIdentityTypeSystemAssigned),\n\t// \t\tPrincipalID: to.Ptr(\"00000000-0000-0000-0000-000000000000\"),\n\t// \t\tTenantID: to.Ptr(\"00000000-0000-0000-0000-000000000000\"),\n\t// \t},\n\t// \tKind: to.Ptr(armwebpubsub.ServiceKindWebPubSub),\n\t// \tProperties: &armwebpubsub.Properties{\n\t// \t\tDisableAADAuth: to.Ptr(false),\n\t// \t\tDisableLocalAuth: to.Ptr(false),\n\t// \t\tExternalIP: to.Ptr(\"10.0.0.1\"),\n\t// \t\tHostName: to.Ptr(\"mywebpubsubservice.webpubsub.azure.com\"),\n\t// \t\tLiveTraceConfiguration: &armwebpubsub.LiveTraceConfiguration{\n\t// \t\t\tCategories: []*armwebpubsub.LiveTraceCategory{\n\t// \t\t\t\t{\n\t// \t\t\t\t\tName: to.Ptr(\"ConnectivityLogs\"),\n\t// \t\t\t\t\tEnabled: to.Ptr(\"true\"),\n\t// \t\t\t}},\n\t// \t\t\tEnabled: to.Ptr(\"false\"),\n\t// \t\t},\n\t// \t\tNetworkACLs: &armwebpubsub.NetworkACLs{\n\t// \t\t\tDefaultAction: to.Ptr(armwebpubsub.ACLActionDeny),\n\t// \t\t\tPrivateEndpoints: []*armwebpubsub.PrivateEndpointACL{\n\t// \t\t\t\t{\n\t// \t\t\t\t\tAllow: []*armwebpubsub.WebPubSubRequestType{\n\t// \t\t\t\t\t\tto.Ptr(armwebpubsub.WebPubSubRequestTypeServerConnection)},\n\t// \t\t\t\t\t\tName: to.Ptr(\"mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e\"),\n\t// \t\t\t\t}},\n\t// \t\t\t\tPublicNetwork: &armwebpubsub.NetworkACL{\n\t// \t\t\t\t\tAllow: []*armwebpubsub.WebPubSubRequestType{\n\t// \t\t\t\t\t\tto.Ptr(armwebpubsub.WebPubSubRequestTypeClientConnection)},\n\t// \t\t\t\t\t},\n\t// \t\t\t\t},\n\t// \t\t\t\tPrivateEndpointConnections: []*armwebpubsub.PrivateEndpointConnection{\n\t// \t\t\t\t\t{\n\t// \t\t\t\t\t\tName: to.Ptr(\"mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e\"),\n\t// \t\t\t\t\t\tType: to.Ptr(\"Microsoft.SignalRService/WebPubSub/privateEndpointConnections\"),\n\t// \t\t\t\t\t\tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/privateEndpointConnections/mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e\"),\n\t// \t\t\t\t\t\tSystemData: &armwebpubsub.SystemData{\n\t// \t\t\t\t\t\t\tCreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2015-02-03T04:05:06Z\"); return t}()),\n\t// \t\t\t\t\t\t\tCreatedBy: to.Ptr(\"string\"),\n\t// \t\t\t\t\t\t\tCreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser),\n\t// \t\t\t\t\t\t\tLastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2015-02-03T04:05:06Z\"); return t}()),\n\t// \t\t\t\t\t\t\tLastModifiedBy: to.Ptr(\"string\"),\n\t// \t\t\t\t\t\t\tLastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser),\n\t// \t\t\t\t\t\t},\n\t// \t\t\t\t\t\tProperties: &armwebpubsub.PrivateEndpointConnectionProperties{\n\t// \t\t\t\t\t\t\tPrivateEndpoint: &armwebpubsub.PrivateEndpoint{\n\t// \t\t\t\t\t\t\t\tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint\"),\n\t// \t\t\t\t\t\t\t},\n\t// \t\t\t\t\t\t\tPrivateLinkServiceConnectionState: &armwebpubsub.PrivateLinkServiceConnectionState{\n\t// \t\t\t\t\t\t\t\tActionsRequired: to.Ptr(\"None\"),\n\t// \t\t\t\t\t\t\t\tStatus: to.Ptr(armwebpubsub.PrivateLinkServiceConnectionStatusApproved),\n\t// \t\t\t\t\t\t\t},\n\t// \t\t\t\t\t\t\tProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded),\n\t// \t\t\t\t\t\t},\n\t// \t\t\t\t}},\n\t// \t\t\t\tProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded),\n\t// \t\t\t\tPublicNetworkAccess: to.Ptr(\"Enabled\"),\n\t// \t\t\t\tPublicPort: to.Ptr[int32](443),\n\t// \t\t\t\tResourceLogConfiguration: &armwebpubsub.ResourceLogConfiguration{\n\t// \t\t\t\t\tCategories: []*armwebpubsub.ResourceLogCategory{\n\t// \t\t\t\t\t\t{\n\t// \t\t\t\t\t\t\tName: to.Ptr(\"ConnectivityLogs\"),\n\t// \t\t\t\t\t\t\tEnabled: to.Ptr(\"true\"),\n\t// \t\t\t\t\t}},\n\t// \t\t\t\t},\n\t// \t\t\t\tServerPort: to.Ptr[int32](443),\n\t// \t\t\t\tTLS: &armwebpubsub.TLSSettings{\n\t// \t\t\t\t\tClientCertEnabled: to.Ptr(true),\n\t// \t\t\t\t},\n\t// \t\t\t\tVersion: to.Ptr(\"1.0\"),\n\t// \t\t\t},\n\t// \t\t\tSKU: &armwebpubsub.ResourceSKU{\n\t// \t\t\t\tName: to.Ptr(\"Premium_P1\"),\n\t// \t\t\t\tCapacity: to.Ptr[int32](1),\n\t// \t\t\t\tSize: to.Ptr(\"P1\"),\n\t// \t\t\t\tTier: to.Ptr(armwebpubsub.WebPubSubSKUTierPremium),\n\t// \t\t\t},\n\t// \t\t}\n}",
"func NewGoogleClient(ps *persist.PersistService, consumer_key string, consumer_secret string) *AuthClient { // scope? []string ?\n\treturn NewAuthClient(ps, \"google\", consumer_key, consumer_secret, \"https://www.google.com/accounts/OAuthGetRequestToken\", \"https://www.google.com/accounts/OAuthGetAccessToken\", \"https://www.google.com/accounts/OAuthAuthorizeToken\");\n\n}",
"func authClient(cacheFile, code string) (*http.Client, error) {\n\tconfig := &oauth.Config{\n\t\tClientId: clientId,\n\t\tClientSecret: clientSecret,\n\t\tScope: storage.DevstorageFull_controlScope,\n\t\tAuthURL: \"https://accounts.google.com/o/oauth2/auth\",\n\t\tTokenURL: \"https://accounts.google.com/o/oauth2/token\",\n\t\tTokenCache: oauth.CacheFile(cacheFile),\n\t\tRedirectURL: \"urn:ietf:wg:oauth:2.0:oob\",\n\t}\n\n\ttransport := &oauth.Transport{\n\t\tConfig: config,\n\t\tTransport: http.DefaultTransport,\n\t}\n\n\ttoken, err := config.TokenCache.Token()\n\tif err != nil {\n\t\tif code == \"\" {\n\t\t\turl := config.AuthCodeURL(\"\")\n\t\t\treturn nil, fmt.Errorf(\"Visit URL to get a code then run again with -code=YOUR_CODE\\n%s\", url)\n\t\t}\n\n\t\t// Exchange auth code for access token\n\t\ttoken, err = transport.Exchange(code)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tlog.Printf(\"Token is cached in %v\\n\", config.TokenCache)\n\t}\n\ttransport.Token = token\n\n\treturn transport.Client(), nil\n}",
"func NewSubscriber(topic, subscriptionID string, conn *grpc.ClientConn) pubsub.Subscriber {\n\treturn &grpcClientWrapper{topic, subscriptionID, NewPubSubClient(conn), make(chan struct{}, 2)}\n}",
"func (r *ReconcileProjectReference) getGcpClient(projectReference *gcpv1alpha1.ProjectReference, logger logr.Logger) (gcpclient.Client, error) {\n\tcredSecretNamespace := operatorNamespace\n\tcredSecretName := orgGcpSecretName\n\tif projectReference.Spec.CCS {\n\t\tcredSecretNamespace = projectReference.Spec.CCSSecretRef.Namespace\n\t\tcredSecretName = projectReference.Spec.CCSSecretRef.Name\n\t}\n\t// Get org creds from secret\n\tcreds, err := util.GetGCPCredentialsFromSecret(r.client, credSecretNamespace, credSecretName)\n\tif err != nil {\n\t\terr = operrors.Wrap(err, fmt.Sprintf(\"could not get Creds from secret: %s, for namespace %s\", credSecretName, credSecretNamespace))\n\t\treturn nil, err\n\t}\n\n\t// Get gcpclient with creds\n\tgcpClient, err := r.gcpClientBuilder(projectReference.Spec.GCPProjectID, creds)\n\tif err != nil {\n\t\treturn nil, operrors.Wrap(err, fmt.Sprintf(\"could not get gcp client with secret: %s, for namespace %s\", credSecretName, credSecretNamespace))\n\t}\n\n\treturn gcpClient, nil\n}",
"func NewClient(ctx context.Context, projectID, bucket string) (*Client, error) {\n\tc, err := gcs.NewClient(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Client{\n\t\tgcsClient: c,\n\t\tprojectID: projectID,\n\t\tbucket: bucket,\n\t}, nil\n}",
"func (g *gitlabConsumer) GetAuthorizedClient(ctx context.Context, vcsAuth sdk.VCSAuth) (sdk.VCSAuthorizedClient, error) {\n\thttpClient := &http.Client{\n\t\tTimeout: 60 * time.Second,\n\t}\n\tif vcsAuth.Type != \"\" {\n\t\tgclient := gitlab.NewClient(httpClient, vcsAuth.Token)\n\t\tc := &gitlabClient{\n\t\t\tclient: gclient,\n\t\t\tuiURL: g.uiURL,\n\t\t\tproxyURL: g.proxyURL,\n\t\t}\n\t\tc.client.SetBaseURL(g.URL + \"/api/v4\")\n\t\treturn c, nil\n\t}\n\n\t// DEPRECATED VCS\n\tgclient := gitlab.NewOAuthClient(httpClient, vcsAuth.AccessToken)\n\tc := &gitlabClient{\n\t\tclient: gclient,\n\t\tuiURL: g.uiURL,\n\t\tdisableStatus: g.disableStatus,\n\t\tdisableStatusDetails: g.disableStatusDetails,\n\t\tproxyURL: g.proxyURL,\n\t}\n\tc.client.SetBaseURL(g.URL + \"/api/v4\")\n\treturn c, nil\n}",
"func NewPubSub(logger *log.Logger, client *redis.Client, connKey string, supervisorMailbox chan interface{}) *PubSub {\n\tctx := context.Background()\n\tredisPubSub := client.Subscribe(ctx)\n\tmailbox := make(chan interface{})\n\tpubsub := &PubSub{\n\t\tConnKey: connKey,\n\t\tSupervisorMailbox: supervisorMailbox,\n\t\tLogger: logger,\n\t\tPubSub: redisPubSub,\n\t\tSubscriber: make(map[string][]Subscriber),\n\t\tMailbox: mailbox,\n\t}\n\n\tgo func() {\n\t\tc := pubsub.PubSub.Channel()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase n, ok := <-pubsub.Mailbox:\n\t\t\t\t// The mailbox is closed. This actor is dying.\n\t\t\t\tif !ok {\n\t\t\t\t\t// Close all subscriber channels\n\t\t\t\t\tfor channelName, subscribers := range pubsub.Subscriber {\n\t\t\t\t\t\tfor _, sub := range subscribers {\n\t\t\t\t\t\t\tpubsub.Logger.Debugf(\"closing channel ID: %v\", sub.SubscriberID)\n\t\t\t\t\t\t\tclose(sub.MessageChannel)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdelete(pubsub.Subscriber, channelName)\n\t\t\t\t\t}\n\t\t\t\t\terr := pubsub.PubSub.Close()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tpubsub.Logger.WithError(err).Errorf(\"failed to clean up all\")\n\t\t\t\t\t}\n\t\t\t\t\t// Exit this actor.\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tswitch n := n.(type) {\n\t\t\t\tcase PubSubMessageJoin:\n\t\t\t\t\tpubsub.Subscriber[n.ChannelName] = append(\n\t\t\t\t\t\tpubsub.Subscriber[n.ChannelName],\n\t\t\t\t\t\t// nolint: gosimple\n\t\t\t\t\t\tSubscriber{\n\t\t\t\t\t\t\tChannelName: n.ChannelName,\n\t\t\t\t\t\t\tSubscriberID: n.SubscriberID,\n\t\t\t\t\t\t\tMessageChannel: n.MessageChannel,\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\n\t\t\t\t\t// Subscribe if it is the first subscriber.\n\t\t\t\t\tif len(pubsub.Subscriber[n.ChannelName]) == 1 {\n\t\t\t\t\t\tpubsub.Logger.Debugf(\"subscribe because the first subscriber is joining\")\n\t\t\t\t\t\tctx := context.Background()\n\t\t\t\t\t\terr := pubsub.PubSub.Subscribe(ctx, n.ChannelName)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tpubsub.Logger.WithError(err).Errorf(\"failed to subscribe: %v\", n.ChannelName)\n\t\t\t\t\t\t\tpubsub.SupervisorMailbox <- HubMessagePubSubDead{\n\t\t\t\t\t\t\t\tConnKey: pubsub.ConnKey,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tcase PubSubMessageLeave:\n\t\t\t\t\t// Close the specific subscriber channel\n\t\t\t\t\tsubscribers := pubsub.Subscriber[n.ChannelName]\n\t\t\t\t\tidx := -1\n\t\t\t\t\tfor i, sub := range subscribers {\n\t\t\t\t\t\tif sub.SubscriberID == n.SubscriberID {\n\t\t\t\t\t\t\tidx = i\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif idx != -1 {\n\t\t\t\t\t\tsub := subscribers[idx]\n\t\t\t\t\t\tpubsub.Logger.Debugf(\"closing channel ID: %v\", sub.SubscriberID)\n\t\t\t\t\t\tclose(sub.MessageChannel)\n\t\t\t\t\t}\n\n\t\t\t\t\tsubscribers = append(subscribers[:idx], subscribers[idx+1:]...)\n\t\t\t\t\tpubsub.Subscriber[n.ChannelName] = subscribers\n\t\t\t\t\tnumRemaining := len(subscribers)\n\n\t\t\t\t\t// Unsubscribe if subscriber is the last one subscribing the channelName.\n\t\t\t\t\tif numRemaining == 0 {\n\t\t\t\t\t\tpubsub.Logger.Debugf(\"unsubscribe because the last subscriber is leaving\")\n\t\t\t\t\t\tctx := context.Background()\n\t\t\t\t\t\terr := pubsub.PubSub.Unsubscribe(ctx, n.ChannelName)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tpubsub.Logger.WithError(err).Errorf(\"failed to unsubscribe: %v\", n.ChannelName)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase n, ok := <-c:\n\t\t\t\tif !ok {\n\t\t\t\t\tpubsub.SupervisorMailbox <- HubMessagePubSubDead{\n\t\t\t\t\t\tConnKey: pubsub.ConnKey,\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tfor _, s := range pubsub.Subscriber[n.Channel] {\n\t\t\t\t\t// The drop pattern\n\t\t\t\t\t// See https://www.ardanlabs.com/blog/2017/10/the-behavior-of-channels.html\n\t\t\t\t\tselect {\n\t\t\t\t\tcase s.MessageChannel <- n:\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tpubsub.Logger.Debugf(\"dropped message to subscriber ID: %v\", s.SubscriberID)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn pubsub\n}",
"func NewGCPClient(keys, projectName string) (*GCPClient, error) {\n\tlog.Debugf(\"Connecting to GCP\")\n\tctx := context.Background()\n\tvar client *GCPClient\n\tif projectName == \"\" {\n\t\treturn nil, fmt.Errorf(\"the project name is not specified\")\n\t}\n\tif keys != \"\" {\n\t\tlog.Debugf(\"Using Keys %s\", keys)\n\t\tf, err := os.Open(keys)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tjsonKey, err := io.ReadAll(f)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tconfig, err := google.JWTConfigFromJSON(jsonKey,\n\t\t\tstorage.DevstorageReadWriteScope,\n\t\t\tcompute.ComputeScope,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tclient = &GCPClient{\n\t\t\tclient: config.Client(ctx),\n\t\t\tprojectName: projectName,\n\t\t}\n\t} else {\n\t\tlog.Debugf(\"Using Application Default credentials\")\n\t\tgc, err := google.DefaultClient(\n\t\t\tctx,\n\t\t\tstorage.DevstorageReadWriteScope,\n\t\t\tcompute.ComputeScope,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tclient = &GCPClient{\n\t\t\tclient: gc,\n\t\t\tprojectName: projectName,\n\t\t}\n\t}\n\n\tvar err error\n\tclient.compute, err = compute.NewService(ctx, option.WithHTTPClient(client.client))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient.storage, err = storage.NewService(ctx, option.WithHTTPClient(client.client))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlog.Debugf(\"Generating SSH Keypair\")\n\tclient.privKey, err = rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn client, nil\n}",
"func (s serviceimpl) GetClient(ctx context.Context) *http.Client {\n\n\tdata, err := ioutil.ReadFile(\"cred.json\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tconf, err := google.JWTConfigFromJSON(data, calendar.CalendarScope)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tclient := conf.Client(ctx)\n\n\treturn client\n}",
"func NewClient(kubeClient client.Client, secretName, namespace, project string) (*gcpClient, error) {\n\tctx := context.Background()\n\tsecret := &corev1.Secret{}\n\terr := kubeClient.Get(ctx, types.NamespacedName{Namespace: namespace, Name: secretName}, secret)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tconfig, err := utils.GetCredentialsJSON(kubeClient, types.NamespacedName{Namespace: namespace, Name: secretName})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tservice, err := dnsv1.NewService(context.Background(), option.WithCredentials(config))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &gcpClient{\n\t\tclient: *service,\n\t\tproject: project,\n\t}, nil\n}",
"func NewGCPPubSubConfig() GCPPubSubConfig {\n\treturn GCPPubSubConfig{\n\t\tProjectID: \"\",\n\t\tTopicID: \"\",\n\t\tMaxInFlight: 64,\n\t\tPublishTimeout: \"60s\",\n\t\tMetadata: metadata.NewExcludeFilterConfig(),\n\t\tOrderingKey: \"\",\n\t\tEndpoint: \"\",\n\t\tFlowControl: NewGCPPubSubFlowControlConfig(),\n\t}\n}",
"func NewClient(apiTokenID string, apiSecret string, logger *log.Logger) (*Client, error) {\n\tif len(apiTokenID) == 0 {\n\t\treturn nil, fmt.Errorf(\"apiTokenID is not set\")\n\t}\n\n\tif len(apiSecret) == 0 {\n\t\treturn nil, fmt.Errorf(\"apiSecret is not set\")\n\t}\n\n\tpublicUrl, err := url.ParseRequestURI(baseUrl)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tprivateUrl, err := url.ParseRequestURI(privateBaseUrl)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar discardLogger = log.New(ioutil.Discard, \"\", log.LstdFlags)\n\tif logger == nil {\n\t\tlogger = discardLogger\n\t}\n\n\tclient := &http.Client{Timeout: time.Duration(10) * time.Second}\n\treturn &Client{URL: publicUrl, PrivateURL: privateUrl, ApiTokenID: apiTokenID, ApiSecret: apiSecret, HTTPClient: client, Logger: logger}, nil\n\n}",
"func (a *Auth) GetClient() (*http.Client, error) {\n\tif a.client == nil {\n\t\tclient, err := getClient(a.credentialsPath, a.tokenPath, a.scopes)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error: Could not get client: %v\", err)\n\t\t}\n\t\ta.client = client\n\t}\n\treturn a.client, nil\n}",
"func NewClient(ctx context.Context, authURL string, options ...ClientConfigOption) (*client.Client, error) {\n\tu, err := url.Parse(authURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclientConfig := ClientConfig{\n\t\thttpClient: http.DefaultClient,\n\t}\n\tfor _, configure := range options {\n\t\tconfigure(&clientConfig)\n\t}\n\tc := client.New(goaclient.HTTPClientDoer(clientConfig.httpClient))\n\tc.Host = u.Host\n\tc.Scheme = u.Scheme\n\t// allow requests with no JWT in the context\n\tif goajwt.ContextJWT(ctx) != nil {\n\t\tc.SetJWTSigner(goasupport.NewForwardSigner(ctx))\n\t} else {\n\t\tlog.Info(ctx, nil, \"no token in context\")\n\t}\n\treturn c, nil\n}",
"func (h *handler) newDefaultPubSubClient(ctx context.Context) (cev2.Client, error) {\n\t// Make a pubsub protocol for the CloudEvents client.\n\tp, err := pubsub.New(ctx,\n\t\tpubsub.WithProjectIDFromDefaultEnv(),\n\t\tpubsub.WithTopicIDFromDefaultEnv())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Use the pubsub prototol to make a new CloudEvents client.\n\treturn cev2.NewClientObserved(p,\n\t\tcev2.WithUUIDs(),\n\t\tcev2.WithTimeNow(),\n\t\tcev2.WithTracePropagation,\n\t)\n}",
"func (a APIKeyAuthentication) GetClient() *http.Client {\n\treturn &a.Client\n}",
"func NewPublisher(topic string, conn *grpc.ClientConn) pubsub.Publisher {\n\treturn &grpcClientWrapper{topic: topic, client: NewPubSubClient(conn)}\n}",
"func NewClient(ctx context.Context, auth *repository.Auth) (repository.Client, error) {\n\tif auth == nil {\n\t\treturn nil, fmt.Errorf(\"Must provide authentication\")\n\t}\n\tif auth.Type() != repository.TokenAuthType {\n\t\treturn nil, fmt.Errorf(\"Unsupported auth type: %s\", auth.Type())\n\t}\n\n\tsts := oauth2.StaticTokenSource(\n\t\t&oauth2.Token{AccessToken: auth.Token},\n\t)\n\thttpClient := oauth2.NewClient(ctx, sts)\n\trtw := newRoundTripperWrapper(httpClient.Transport)\n\thttpClient.Transport = rtw\n\treturn &client{\n\t\tghClient: githubv4.NewClient(httpClient),\n\t}, nil\n}",
"func NewAuthClient(host, version, authstring, accesstoken, userAgent string) (*Client, error) {\n\tbaseURL, err := url.Parse(host)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif baseURL.Path == \"\" {\n\t\tbaseURL.Path = \"/\"\n\t}\n\tunix2HTTP(baseURL)\n\thClient := getHTTPClient(host)\n\tif hClient == nil {\n\t\treturn nil, fmt.Errorf(\"Unable to parse provided url: %v\", host)\n\t}\n\tc := &Client{\n\t\tbase: baseURL,\n\t\tversion: version,\n\t\thttpClient: hClient,\n\t\tauthstring: authstring,\n\t\taccesstoken: accesstoken,\n\t\tuserAgent: fmt.Sprintf(\"%v/%v\", userAgent, version),\n\t}\n\treturn c, nil\n}",
"func NewAuthClient(logger *zap.Logger, credPath string, tokenPath string) (*AuthClient, error) {\n\tb, err := ioutil.ReadFile(credPath)\n\tif err != nil {\n\t\tlogger.Error(\"Unable to read client secret file\", zap.Error(err))\n\t\treturn nil, err\n\t}\n\n\tconfig, err := google.ConfigFromJSON(b,\n\t\tadmin.AdminDirectoryGroupReadonlyScope,\n\t\tadmin.AdminDirectoryGroupMemberReadonlyScope,\n\t\tadmin.AdminDirectoryUserReadonlyScope,\n\t)\n\n\tif err != nil {\n\t\tlogger.Error(\"unable to parse config from JSON\", zap.Error(err))\n\t\treturn nil, err\n\t}\n\n\treturn &AuthClient{\n\t\tlogger: logger,\n\t\tcredentialsPath: credPath,\n\t\ttokenPath: tokenPath,\n\t\tconfig: config,\n\t}, nil\n}",
"func NewClient(opts *cli.Options) (pulsar.Client, error) {\n\tclientOpts := pulsar.ClientOptions{\n\t\tURL: opts.Pulsar.Address,\n\t\tOperationTimeout: 30 * time.Second,\n\t\tConnectionTimeout: opts.Pulsar.ConnectTimeout,\n\t\tTLSAllowInsecureConnection: opts.Pulsar.InsecureTLS,\n\t}\n\n\tif opts.Pulsar.AuthCertificateFile != \"\" && opts.Pulsar.AuthKeyFile != \"\" {\n\t\tclientOpts.Authentication = pulsar.NewAuthenticationTLS(opts.Pulsar.AuthCertificateFile, opts.Pulsar.AuthKeyFile)\n\t}\n\n\tclient, err := pulsar.NewClient(clientOpts)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"Could not instantiate Pulsar client\")\n\t}\n\n\treturn client, nil\n}",
"func NewGCPClient(config config.ConfigView, outputs terraform.Outputs, workingdir workingdir.IClient, stdout, stderr io.Writer, provider iaas.Provider, boshCLI boshcli.ICLI, versionFile []byte) (IClient, error) {\n\treturn &GCPClient{\n\t\tconfig: config,\n\t\toutputs: outputs,\n\t\tworkingdir: workingdir,\n\t\tstdout: stdout,\n\t\tstderr: stderr,\n\t\tprovider: provider,\n\t\tboshCLI: boshCLI,\n\t\tversionFile: versionFile,\n\t}, nil\n}",
"func GetClient() *mongo.Client {\n\treturn primaryMongoClient\n}",
"func New(nameClient string) *PubSub {\n\n\tp := &PubSub{}\n\tsubscriptions = make(map[string]chan []byte)\n\n\topts := MQTT.NewClientOptions().AddBroker(\"tcp://127.0.0.1:1883\")\n\topts.SetClientID(nameClient)\n\topts.SetDefaultPublishHandler(f)\n\topts.SetOnConnectHandler(onConnection)\n\topts.SetAutoReconnect(true)\n\tp.Conn = MQTT.NewClient(opts)\n\treturn p\n}",
"func GetClient() *Client {\n\treturn organizationServiceClient\n}",
"func (c PubSubConfig) NewPubSub(comp *component.Component, server io.Server) (*pubsub.PubSub, error) {\n\tif c.Registry == nil {\n\t\treturn nil, nil\n\t}\n\tstatuses, err := pubsub.ProviderStatusesFromMap(comp.Context(), c.Providers)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn pubsub.New(comp, server, c.Registry, statuses)\n}",
"func AuthClient(auth func() auth.Auth, c client.Client) client.Client {\n\treturn &authWrapper{c, auth}\n}",
"func New(clientID string, options ...Option) (Client, error) {\n\topts := clientOptions{\n\t\tauthority: base.AuthorityPublicCloud,\n\t\thttpClient: shared.DefaultClient,\n\t}\n\n\tfor _, o := range options {\n\t\to(&opts)\n\t}\n\tif err := opts.validate(); err != nil {\n\t\treturn Client{}, err\n\t}\n\n\tbase, err := base.New(clientID, opts.authority, oauth.New(opts.httpClient), base.WithCacheAccessor(opts.accessor), base.WithClientCapabilities(opts.capabilities), base.WithInstanceDiscovery(!opts.disableInstanceDiscovery))\n\tif err != nil {\n\t\treturn Client{}, err\n\t}\n\treturn Client{base}, nil\n}",
"func GetClient(username, password string) *Client {\n\treturn &Client{\n\t\tUsername: username,\n\t\tPassword: password,\n\t\tbaseURL: base_url,\n\t}\n}",
"func NewClient(pkey, skey string) (*Client, error) {\n\tswitch {\n\tcase pkey == \"\" && skey == \"\":\n\t\treturn nil, ErrInvalidKey\n\tcase pkey != \"\" && !strings.HasPrefix(pkey, \"pkey_\"):\n\t\treturn nil, ErrInvalidKey\n\tcase skey != \"\" && !strings.HasPrefix(skey, \"skey_\"):\n\t\treturn nil, ErrInvalidKey\n\t}\n\n\tclient := &Client{\n\t\tClient: &http.Client{Transport: transport},\n\t\tdebug: false,\n\t\tpkey: pkey,\n\t\tskey: skey,\n\n\t\tEndpoints: map[internal.Endpoint]string{},\n\t}\n\n\tif len(build.Default.ReleaseTags) > 0 {\n\t\tclient.GoVersion = build.Default.ReleaseTags[len(build.Default.ReleaseTags)-1]\n\t}\n\n\treturn client, nil\n}",
"func NewClient(clientID, email, password string, ttl int) *Client {\n\treturn &Client{\n\t\tClientID: clientID,\n\t\tEmail: email,\n\t\tPassword: password,\n\t\tTTL: ttl,\n\t\tHTTPClient: &http.Client{},\n\t\tapiBaseURL: apiBaseURL,\n\t\tloginURL: loginURL,\n\t}\n}",
"func NewPubSubPublisher(ctx context.Context, projectID, topicName string) (p *PubSubPublisher, err error) {\n\n\tif projectID == \"\" || topicName == \"\" {\n\t\treturn nil, errors.New(\"Invalid project or topic arguments\")\n\t}\n\n\t// pubsub client\n\tc, err := pubsub.NewClient(ctx, projectID)\n\tif err != nil {\n\t\tlog.Panicf(\"Failed to create client: %v\", err)\n\t}\n\n\tpublisher := &PubSubPublisher{\n\t\ttopic: c.Topic(topicName),\n\t}\n\n\treturn publisher, nil\n\n}",
"func (b *Broker) GetCertPubSub() *pubsub.PubSub {\n\treturn b.certPubSub\n}",
"func New(projectID, topicName, subscriberName string, opts ...option.ClientOption) (eventbus.EventBus, error) {\n\tret := &distEventBus{\n\t\tlocalEventBus: eventbus.New(),\n\t\twrapperCodec: util.NewJSONCodec(&channelWrapper{}),\n\t\tstorageNotifications: eventbus.NewNotificationsMap(),\n\t\tprojectID: projectID,\n\t\ttopicID: topicName,\n\t}\n\n\t// Create the client.\n\tvar err error\n\tret.client, err = pubsub.NewClient(context.TODO(), projectID, opts...)\n\tif err != nil {\n\t\treturn nil, skerr.Wrapf(err, \"creating pubsub client for project %s\", projectID)\n\t}\n\n\t// Set up the pubsub client, topic and subscription.\n\tif err := ret.setupTopicSub(topicName, subscriberName); err != nil {\n\t\treturn nil, skerr.Wrapf(err, \"setting up topic with name %s as subscriber %s\", topicName, subscriberName)\n\t}\n\n\t// Start the receiver.\n\tret.startReceiver()\n\treturn ret, nil\n}",
"func New() *PubSub {\n\treturn &PubSub{\n\t\tMaxSubs: 20,\n\t\tregistry: make(map[string]*topic),\n\t}\n}",
"func NewClient(kclient k8s.Client) (*Client, error) {\n\tctx := context.Background()\n\tsecret := &corev1.Secret{}\n\terr := kclient.Get(\n\t\tctx,\n\t\ttypes.NamespacedName{\n\t\t\tName: config.GCPSecretName,\n\t\t\tNamespace: config.OperatorNamespace,\n\t\t},\n\t\tsecret)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"couldn't get Secret with credentials %w\", err)\n\t}\n\tserviceAccountJSON, ok := secret.Data[\"service_account.json\"]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"access credentials missing service account\")\n\t}\n\n\t// initialize actual client\n\tc, err := newClient(ctx, serviceAccountJSON)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"couldn't create GCP client %s\", err)\n\t}\n\n\t// enchant the client with params required\n\tregion, err := getClusterRegion(kclient)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc.region = region\n\n\tmasterList, err := baseutils.GetMasterMachines(kclient)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc.masterList = masterList\n\tinfrastructureName, err := baseutils.GetClusterName(kclient)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc.clusterName = infrastructureName\n\tbaseDomain, err := baseutils.GetClusterBaseDomain(kclient)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc.baseDomain = baseDomain\n\n\treturn c, nil\n}",
"func NewPublisher(configPath string) *Publisher {\n\tctx := context.Background()\n\tconfig, _ := configuration.GetConfig(configPath)\n\n\tpubsubClient, err := pubsub.NewClient(ctx, config.GCP.Project)\n\n\tif err != nil {\n\t\tlog.Fatal(\"Could not create pubsub client: \", err)\n\t}\n\n\treturn &Publisher{Client: *pubsubClient, context: ctx, config: config}\n}",
"func NewGoogleAuth() *googleOauth {\n\toidcProvider, err := oidc.NewProvider(context.Background(), googleOidcProviderURL)\n\tif err != nil {\n\t\tlog.Fatalf(\"Could not initialize googleAuth - %#v\", err)\n\t}\n\tkey := make([]byte, 64)\n\t_, err = rand.Read(key)\n\tif err != nil {\n\t\tlog.Fatalf(\"Could not initialize googleAuth - %#v\", err)\n\t}\n\tkeypair, aesSIVErr := siv.NewAesSIVBlockPair(key)\n\tif aesSIVErr != nil {\n\t\tlog.Fatalf(\"Could not initialize googleAuth - %#v\", aesSIVErr)\n\t}\n\tsiv, sivErr := siv.NewSIV(keypair)\n\tif sivErr != nil {\n\t\tlog.Fatalf(\"Could not initialize googleAuth - %#v\", sivErr)\n\t}\n\n\treturn &googleOauth{\n\t\toAuthConfig: &oauth2.Config{\n\t\t\tClientID: googleClientID,\n\t\t\tClientSecret: googleClientSecret,\n\t\t\tScopes: []string{\n\t\t\t\t\"https://www.googleapis.com/auth/userinfo.email\",\n\t\t\t\t\"https://www.googleapis.com/auth/userinfo.profile\",\n\t\t\t\t\"openid\",\n\t\t\t},\n\t\t\tEndpoint: google.Endpoint,\n\t\t},\n\t\topenIDCProvider: oidcProvider,\n\t\tsiv: siv,\n\t}\n}",
"func (s *Storage) GetClient(client_id string) (osin.Client, error) {\n\tapplication, err := data.GetApplicationWithClientId(s.db, client_id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif application == nil {\n\t\treturn nil, fmt.Errorf(\"no such application\")\n\t}\n\n\tclient := &osin.DefaultClient{\n\t\tId: application.ClientId,\n\t\tSecret: application.ClientSecret,\n\t\tRedirectUri: application.RedirectURI,\n\t\tUserData: application,\n\t}\n\n\treturn client, nil\n}",
"func analyticsClient(clientid string, secret string, tokenstr string) (*http.Client, error) {\n\tctx := context.Background()\n\n\tconfig := &oauth2.Config{\n\t\tClientID: clientid,\n\t\tClientSecret: secret,\n\t\tEndpoint: google.Endpoint,\n\t\tScopes: []string{analytics.AnalyticsScope},\n\t}\n\n\ttoken := new(oauth2.Token)\n\t// Decode the base64'd gob\n\tby, err := base64.StdEncoding.DecodeString(tokenstr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tb := bytes.Buffer{}\n\tb.Write(by)\n\td := gob.NewDecoder(&b)\n\terr = d.Decode(&token)\n\n\treturn config.Client(ctx, token), nil\n}",
"func NewAccountClient(subscriptionID string) AccountClient {\n return NewAccountClientWithBaseURI(DefaultBaseURI, subscriptionID)\n}",
"func NewClient(c client.Client, baseURL, publicKey, privateKey string) *Client {\n\treturn &Client{\n\t\tClient: c,\n\t\thash: hmac.New(sha256.New, []byte(privateKey)),\n\t\tpublicKey: publicKey,\n\t\tbaseURL: baseURL,\n\t}\n}",
"func NewClient(kubeconfig string) (client versioned.Interface, err error) {\n\tvar config *rest.Config\n\tconfig, err = getConfig(kubeconfig)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn versioned.NewForConfig(config)\n}",
"func NewClient() *http.Client {\n\tctx := context.Background()\n\thttpClient := &http.Client{Timeout: 2 * time.Second}\n\tctx = context.WithValue(ctx, oauth2.HTTPClient, httpClient)\n\t//TODO: Error handling code\n\tconfig := getOauthConfig()\n\tclient, _ := userOAuthClient(ctx, config)\n\treturn client\n}",
"func NewClient(topic string) *Client {\n\treturn &Client{\n\t\ttopic,\n\t\ttime.Now(),\n\t\tmake(chan *Message),\n\t}\n}",
"func GetClient(logger *zap.SugaredLogger, cfg *config.Config) (Interface, error) {\n\tcp, err := config.NewConfigurationProvider(cfg)\n\tif err != nil {\n\t\tlogger.With(zap.Error(err)).Fatal(\"Unable to create client.\")\n\t\treturn nil, err\n\t}\n\n\trateLimiter := NewRateLimiter(logger, cfg.RateLimiter)\n\n\tc, err := New(logger, cp, &rateLimiter)\n\treturn c, err\n}",
"func GetP2PClient(magic uint32, clientId uint64, seeds []string) (P2PClient, error) {\n\treturn NewP2PClientImpl(magic, clientId, seeds)\n}",
"func NewClient(registryURL string) *Client {\n\treturn &Client{\n\t\turl: registryURL + \"/sgulreg/services\",\n\t\thttpClient: http.DefaultClient,\n\t\treqMux: &sync.RWMutex{},\n\t\tregistered: false,\n\t}\n}",
"func NewClient(subdomain, apiKey string) *Client {\n\tc := &Client{Client: recurly.NewClient(subdomain, apiKey)}\n\n\t// Attach mock implementations.\n\tc.Client.Accounts = &c.Accounts\n\tc.Client.AddOns = &c.AddOns\n\tc.Client.Adjustments = &c.Adjustments\n\tc.Client.Billing = &c.Billing\n\tc.Client.Coupons = &c.Coupons\n\tc.Client.CreditPayments = &c.CreditPayments\n\tc.Client.Redemptions = &c.Redemptions\n\tc.Client.Invoices = &c.Invoices\n\tc.Client.Plans = &c.Plans\n\tc.Client.Purchases = &c.Purchases\n\tc.Client.ShippingAddresses = &c.ShippingAddresses\n\tc.Client.ShippingMethods = &c.ShippingMethods\n\tc.Client.Subscriptions = &c.Subscriptions\n\tc.Client.Transactions = &c.Transactions\n\treturn c\n}",
"func NewClient(authToken string) *Client {\n\treturn &Client{\n\t\tBaseURL: apiURLv1,\n\t\tHTTPClient: newTransport(),\n\t\tauthToken: authToken,\n\t\tidOrg: \"\",\n\t}\n}",
"func NewClient(config Config) ClientInterface {\n\tcontext := ctx.Background()\n\tif config.GitHubToken == \"\" {\n\t\treturn Client{\n\t\t\tClient: github.NewClient(nil),\n\t\t\tContext: context,\n\t\t\tConfig: config,\n\t\t}\n\t}\n\toauth2Client := oauth2.NewClient(context, oauth2.StaticTokenSource(\n\t\t&oauth2.Token{AccessToken: config.GitHubToken},\n\t))\n\treturn Client{\n\t\tClient: github.NewClient(oauth2Client),\n\t\tContext: context,\n\t\tConfig: config,\n\t}\n}",
"func NewClient(clientID, rawURL, topic string, retain bool) (*Client, error) {\n\turi, _ := url.Parse(rawURL)\n\tusername := uri.User.Username()\n\tpassword, _ := uri.User.Password()\n\n\tconn, err := net.Dial(\"tcp\", uri.Host)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient := mqtt.NewClientConn(conn)\n\tif err := client.Connect(username, password); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Client{client: client, topic: topic, retain: retain}, nil\n}",
"func NewClient() *cloudsearchdomain.CloudSearchDomain {\n\tcloudSearchEndpoint := os.Getenv(\"CLOUD_SEARCH_ENDPOINT\")\n\tif cloudSearchEndpoint == \"\" {\n\t\tpanic(\"CLOUD_SEARCH_ENDPOINT env is empty. It must contains the endpoint value\")\n\t}\n\tregion := os.Getenv(\"REGION\")\n\tif region == \"\" {\n\t\tpanic(\"REGION env variable is empty. It must contains the region of the CloudSearch instance\")\n\t}\n\tprofile := os.Getenv(\"PROFILE\")\n\tcred := credentials.NewEnvCredentials()\n\tconfig := aws.Config{\n\t\tCredentials: cred,\n\t\tRegion: aws.String(region),\n\t\tEndpoint: aws.String(cloudSearchEndpoint),\n\t}\n\tsess := session.Must(session.NewSessionWithOptions(session.Options{\n\t\tProfile: profile,\n\t\tConfig: config,\n\t}))\n\n\t// Create a CloudSearchDomain client from just a session.\n\tsvc := cloudsearchdomain.New(sess)\n\n\treturn svc\n}",
"func NewClient() *Client {\n\treturn &Client{\n\t\tsubs: make(map[int]*Subscription),\n\t}\n}",
"func NewClient(clientID string) *Client {\n\treturn &Client{\n\t\tApi: &soundcloud.Api{\n\t\t\tClientId: clientID,\n\t\t},\n\t\tclientID: clientID,\n\t\thc: &http.Client{\n\t\t\tTimeout: 5 * time.Second,\n\t\t},\n\t}\n}",
"func GetClient() *http.Client {\n\tb, err := ioutil.ReadFile(credentials)\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to read client secret file: %v\", err)\n\t}\n\n\tcred, err := google.CredentialsFromJSON(context.Background(), b, scopes...)\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to parse credentials file: %v\", err)\n\t}\n\n\ttok, err := cred.TokenSource.Token()\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to get token: %v\", err)\n\t}\n\n\treturn config.Client(context.Background(), tok)\n}",
"func GetGoogleClient(ctx context.Context, config *oauth2.Config) *http.Client {\n\n\t// cacheFile is the file path for credential file.\n\tcacheFile, err := getFilepathTokenCache()\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to get path to cached credential file. %v\", err)\n\t}\n\n\t// tok is a token Object that reads cacheFile (credential file)\n\ttok, err := getGoogleTokenFromFile(cacheFile)\n\tif err != nil {\n\t\t// prompts users to retrieve a token from browser.\n\t\t// retruns a oauth2.Token object.\n\t\ttok = getGoogleTokenFromWeb(config)\n\n\t\t// save a oauth2.Token object to the file path.\n\t\tsaveGoogleToken(cacheFile, tok)\n\t}\n\n\t// Client returns an HTTP client using the provided token. The token\n\t// will auto-refresh as necessary. The underlying HTTP transport will\n\t// be obtained using the provided context. The returned client and\n\t// its Transport should not be modified.\n\treturn config.Client(ctx, tok)\n}",
"func (a *Client) GetPrivateSubscribe(params *GetPrivateSubscribeParams) (*GetPrivateSubscribeOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetPrivateSubscribeParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"GetPrivateSubscribe\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/private/subscribe\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &GetPrivateSubscribeReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsuccess, ok := result.(*GetPrivateSubscribeOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\t// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue\n\tmsg := fmt.Sprintf(\"unexpected success response for GetPrivateSubscribe: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}",
"func (c PubSubConfig) NewPubSub(comp *component.Component, server io.Server) (*pubsub.PubSub, error) {\n\tif c.Registry == nil {\n\t\treturn nil, nil\n\t}\n\treturn pubsub.New(comp, server, c.Registry)\n}",
"func NewClient() (Client, error) {\n\ttoken, err := iv_auth.LoadCredentials()\n\tif err != nil {\n\t\tlog.Panicln(err)\n\t}\n\n\treturn &client{oauthToken: token}, nil\n}",
"func NewClient(zoomURL, apiKey, apiSecret string) *Client {\n\tif zoomURL == \"\" {\n\t\tzoomURL = (&url.URL{\n\t\t\tScheme: \"https\",\n\t\t\tHost: zoomAPIKey,\n\t\t\tPath: \"/\" + zoomAPIVersion,\n\t\t}).String()\n\t}\n\n\treturn &Client{\n\t\tapiKey: apiKey,\n\t\tapiSecret: apiSecret,\n\t\thttpClient: &http.Client{},\n\t\tbaseURL: zoomURL,\n\t}\n}",
"func NewClient(clientID, email, password string, ttl int) *Client {\n\tbaseURL, _ := url.Parse(apiBaseURL)\n\tloginBaseURL, _ := url.Parse(loginURL)\n\n\treturn &Client{\n\t\tclientID: clientID,\n\t\temail: email,\n\t\tpassword: password,\n\t\tttl: ttl,\n\t\tapiBaseURL: baseURL,\n\t\tloginURL: loginBaseURL,\n\t\tHTTPClient: &http.Client{Timeout: 5 * time.Second},\n\t}\n}",
"func oauth2Client(ctx context.Context) *github.Client {\n\tvar oauthClient *http.Client\n\tif token := getGithubToken(); token != \"\" {\n\t\tts := oauth2.StaticTokenSource(\n\t\t\t&oauth2.Token{AccessToken: getGithubToken()},\n\t\t)\n\t\toauthClient = oauth2.NewClient(ctx, ts)\n\t}\n\treturn github.NewClient(oauthClient)\n}",
"func NewClient(config *config.Config) Client {\n\treturn &releaseClient{\n\t\tconfig: config,\n\t}\n}",
"func GetClient(token string) *godo.Client {\n\ttokenSource := &TokenSource{AccessToken: token}\n\toauthClient := oauth2.NewClient(oauth2.NoContext, tokenSource)\n\tclient := godo.NewClient(oauthClient)\n\tclient.BaseURL = GodoBase\n\treturn client\n}",
"func NewClient(endpoint string, cli *http.Client) (*Client, error) {\n\tu, err := url.ParseRequestURI(endpoint)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"gaurun: failed to parse url - endpoint = %s: %w\", endpoint, err)\n\t}\n\n\tif cli == nil {\n\t\tcli = http.DefaultClient\n\t}\n\n\treturn &Client{\n\t\tEndpoint: u,\n\t\tHTTPClient: cli,\n\t}, nil\n}",
"func New(opt *Options) (*client, error) {\n\tif err := opt.init(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &client{\n\t\tappKey: opt.AppKey,\n\t\tappSecret: opt.AppSecret,\n\t\tsid: opt.SID,\n\t\tbaseURL: opt.BaseURL,\n\t\thttpClient: opt.HttpClient,\n\t}, nil\n}",
"func NewClient(subscriptionID string, authorizer autorest.Authorizer) Client {\n\treturn NewClientWithBaseURI(DefaultBaseURI, subscriptionID, authorizer)\n}",
"func NewPublicClient(_ *http.Request) (Client, http.Header, error) {\n\treturn newClientWithOptions(option.WithHTTPClient(http.DefaultClient))\n}"
] | [
"0.67263144",
"0.64401406",
"0.6434849",
"0.6243881",
"0.61175317",
"0.59619075",
"0.5948689",
"0.59461606",
"0.5833395",
"0.5774761",
"0.57634735",
"0.56945395",
"0.55894965",
"0.5566611",
"0.556053",
"0.55195254",
"0.55149347",
"0.55052865",
"0.5441519",
"0.543098",
"0.542387",
"0.5423733",
"0.54074633",
"0.5394219",
"0.5384204",
"0.5361954",
"0.53528965",
"0.53229165",
"0.5316795",
"0.53117675",
"0.5307096",
"0.530464",
"0.52691233",
"0.526848",
"0.5252083",
"0.5220513",
"0.519419",
"0.51300484",
"0.5122806",
"0.51114255",
"0.5110065",
"0.50936204",
"0.5093356",
"0.5086756",
"0.5082099",
"0.50807345",
"0.50689757",
"0.5065198",
"0.505922",
"0.50510204",
"0.5047843",
"0.5026958",
"0.5021863",
"0.50149167",
"0.5014674",
"0.50132054",
"0.50070626",
"0.5003823",
"0.49899948",
"0.49851948",
"0.4971208",
"0.495435",
"0.49534732",
"0.4949369",
"0.49321038",
"0.4925168",
"0.49028453",
"0.48978955",
"0.48918715",
"0.48856178",
"0.48836482",
"0.4881345",
"0.48761085",
"0.48719254",
"0.48704547",
"0.48698622",
"0.48674402",
"0.48661235",
"0.4865966",
"0.48648328",
"0.4856086",
"0.48547566",
"0.48546985",
"0.48521665",
"0.4851479",
"0.48459107",
"0.48457283",
"0.4845168",
"0.48377773",
"0.48376182",
"0.48286772",
"0.48283115",
"0.48272485",
"0.48254126",
"0.48206723",
"0.48177627",
"0.4815445",
"0.4814939",
"0.4814891",
"0.48148578"
] | 0.7993007 | 0 |
dstech Let T be the tridiagonal matrix with diagonal entries A(1) ,..., A(N) and offdiagonal entries B(1) ,..., B(N1)). DSTECH checks to see if EIG(1) ,..., EIG(N) are indeed accurate eigenvalues of T. It does this by expanding each EIG(I) into an interval [SVD(I) EPS, SVD(I) + EPS], merging overlapping intervals if any, and using Sturm sequences to count and verify whether each resulting interval has the correct number of eigenvalues (using DSTECT). Here EPS = TOLMAZHEPSMAXEIG, where MACHEPS is the machine precision and MAXEIG is the absolute value of the largest eigenvalue. If each interval contains the correct number of eigenvalues, INFO = 0 is returned, otherwise INFO is the index of the first eigenvalue in the first bad interval. | func dstech(n int, a, b, eig *mat.Vector, tol float64, work *mat.Vector) (info int) {
var emin, eps, lower, mx, tuppr, unflep, upper, zero float64
var bpnt, count, i, isub, j, numl, numu, tpnt int
zero = 0.0
// Check input parameters
info = 0
if n == 0 {
return
}
if n < 0 {
info = -1
return
}
if tol < zero {
info = -5
return
}
// Get machine constants
eps = golapack.Dlamch(Epsilon) * golapack.Dlamch(Base)
unflep = golapack.Dlamch(SafeMinimum) / eps
eps = tol * eps
// Compute maximum absolute eigenvalue, error tolerance
mx = math.Abs(eig.Get(0))
for i = 2; i <= n; i++ {
mx = math.Max(mx, math.Abs(eig.Get(i-1)))
}
eps = math.Max(eps*mx, unflep)
// Sort eigenvalues from EIG into WORK
for i = 1; i <= n; i++ {
work.Set(i-1, eig.Get(i-1))
}
for i = 1; i <= n-1; i++ {
isub = 1
emin = work.Get(0)
for j = 2; j <= n+1-i; j++ {
if work.Get(j-1) < emin {
isub = j
emin = work.Get(j - 1)
}
}
if isub != n+1-i {
work.Set(isub-1, work.Get(n+1-i-1))
work.Set(n+1-i-1, emin)
}
}
// TPNT points to singular value at right endpoint of interval
// BPNT points to singular value at left endpoint of interval
tpnt = 1
bpnt = 1
// Begin loop over all intervals
label50:
;
upper = work.Get(tpnt-1) + eps
lower = work.Get(bpnt-1) - eps
// Begin loop merging overlapping intervals
label60:
;
if bpnt == n {
goto label70
}
tuppr = work.Get(bpnt) + eps
if tuppr < lower {
goto label70
}
// Merge
bpnt = bpnt + 1
lower = work.Get(bpnt-1) - eps
goto label60
label70:
;
// Count singular values in interval [ LOWER, UPPER ]
numl = dstect(n, a, b, lower)
numu = dstect(n, a, b, upper)
count = numu - numl
if count != bpnt-tpnt+1 {
// Wrong number of singular values in interval
info = tpnt
return
}
tpnt = bpnt + 1
bpnt = tpnt
if tpnt <= n {
goto label50
}
return
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func ddrvgt(dotype []bool, nn int, nval []int, nrhs int, thresh float64, tsterr bool, a, af, b, x, xact, work, rwork *mat.Vector, iwork []int, t *testing.T) {\n\tvar zerot bool\n\tvar dist, fact, _type byte\n\tvar trans mat.MatTrans\n\tvar ainvnm, anorm, anormi, anormo, cond, one, rcond, rcondc, rcondi, rcondo, zero float64\n\tvar i, ifact, imat, in, info, ix, izero, j, k, k1, kl, koff, ku, lda, m, mode, n, nerrs, nfail, nimat, nrun, nt, ntypes int\n\tvar err error\n\n\tresult := vf(6)\n\tz := vf(3)\n\tiseed := make([]int, 4)\n\tiseedy := make([]int, 4)\n\tinfot := &gltest.Common.Infoc.Infot\n\tsrnamt := &gltest.Common.Srnamc.Srnamt\n\n\tone = 1.0\n\tzero = 0.0\n\tntypes = 12\n\t// ntests = 6\n\n\tiseedy[0], iseedy[1], iseedy[2], iseedy[3] = 0, 0, 0, 1\n\n\tpath := \"Dgt\"\n\talasvmStart(path)\n\tnrun = 0\n\tnfail = 0\n\tnerrs = 0\n\tfor i = 1; i <= 4; i++ {\n\t\tiseed[i-1] = iseedy[i-1]\n\t}\n\n\t// Test the error exits\n\tif tsterr {\n\t\tderrvx(path, t)\n\t}\n\t(*infot) = 0\n\n\tfor in = 1; in <= nn; in++ {\n\t\t// Do for each value of N in NVAL.\n\t\tn = nval[in-1]\n\t\tm = max(n-1, 0)\n\t\tlda = max(1, n)\n\t\tnimat = ntypes\n\t\tif n <= 0 {\n\t\t\tnimat = 1\n\t\t}\n\n\t\tfor imat = 1; imat <= nimat; imat++ {\n\t\t\t// Do the tests only if DOTYPE( IMAT ) is true.\n\t\t\tif !dotype[imat-1] {\n\t\t\t\tgoto label130\n\t\t\t}\n\n\t\t\t// Set up parameters with DLATB4.\n\t\t\t_type, kl, ku, anorm, mode, cond, dist = dlatb4(path, imat, n, n)\n\n\t\t\tzerot = imat >= 8 && imat <= 10\n\t\t\tif imat <= 6 {\n\t\t\t\t// Types 1-6: generate matrices of known condition number.\n\t\t\t\tkoff = max(2-ku, 3-max(1, n))\n\t\t\t\t*srnamt = \"Dlatms\"\n\t\t\t\tif info, _ = matgen.Dlatms(n, n, dist, &iseed, _type, rwork, mode, cond, anorm, kl, ku, 'Z', af.Off(koff-1).Matrix(3, opts), work); info != 0 {\n\t\t\t\t\tnerrs = alaerh(path, \"Dlatms\", info, 0, []byte(\" \"), n, n, kl, ku, -1, imat, nfail, nerrs)\n\t\t\t\t\tgoto label130\n\t\t\t\t}\n\t\t\t\tizero = 0\n\t\t\t\t//\n\t\t\t\tif n > 1 {\n\t\t\t\t\ta.Copy(n-1, af.Off(3), 3, 1)\n\t\t\t\t\ta.Off(n+m).Copy(n-1, af.Off(2), 3, 1)\n\t\t\t\t}\n\t\t\t\ta.Off(m).Copy(n, af.Off(1), 3, 1)\n\t\t\t} else {\n\t\t\t\t// Types 7-12: generate tridiagonal matrices with\n\t\t\t\t// unknown condition numbers.\n\t\t\t\tif !zerot || !dotype[6] {\n\t\t\t\t\t// Generate a matrix with elements from [-1,1].\n\t\t\t\t\tgolapack.Dlarnv(2, &iseed, n+2*m, a)\n\t\t\t\t\tif anorm != one {\n\t\t\t\t\t\ta.Scal(n+2*m, anorm, 1)\n\t\t\t\t\t}\n\t\t\t\t} else if izero > 0 {\n\t\t\t\t\t// Reuse the last matrix by copying back the zeroed out\n\t\t\t\t\t// elements.\n\t\t\t\t\tif izero == 1 {\n\t\t\t\t\t\ta.Set(n-1, z.Get(1))\n\t\t\t\t\t\tif n > 1 {\n\t\t\t\t\t\t\ta.Set(0, z.Get(2))\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if izero == n {\n\t\t\t\t\t\ta.Set(3*n-2-1, z.Get(0))\n\t\t\t\t\t\ta.Set(2*n-1-1, z.Get(1))\n\t\t\t\t\t} else {\n\t\t\t\t\t\ta.Set(2*n-2+izero-1, z.Get(0))\n\t\t\t\t\t\ta.Set(n-1+izero-1, z.Get(1))\n\t\t\t\t\t\ta.Set(izero-1, z.Get(2))\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If IMAT > 7, set one column of the matrix to 0.\n\t\t\t\tif !zerot {\n\t\t\t\t\tizero = 0\n\t\t\t\t} else if imat == 8 {\n\t\t\t\t\tizero = 1\n\t\t\t\t\tz.Set(1, a.Get(n-1))\n\t\t\t\t\ta.Set(n-1, zero)\n\t\t\t\t\tif n > 1 {\n\t\t\t\t\t\tz.Set(2, a.Get(0))\n\t\t\t\t\t\ta.Set(0, zero)\n\t\t\t\t\t}\n\t\t\t\t} else if imat == 9 {\n\t\t\t\t\tizero = n\n\t\t\t\t\tz.Set(0, a.Get(3*n-2-1))\n\t\t\t\t\tz.Set(1, a.Get(2*n-1-1))\n\t\t\t\t\ta.Set(3*n-2-1, zero)\n\t\t\t\t\ta.Set(2*n-1-1, zero)\n\t\t\t\t} else {\n\t\t\t\t\tizero = (n + 1) / 2\n\t\t\t\t\tfor i = izero; i <= n-1; i++ {\n\t\t\t\t\t\ta.Set(2*n-2+i-1, zero)\n\t\t\t\t\t\ta.Set(n-1+i-1, zero)\n\t\t\t\t\t\ta.Set(i-1, zero)\n\t\t\t\t\t}\n\t\t\t\t\ta.Set(3*n-2-1, zero)\n\t\t\t\t\ta.Set(2*n-1-1, zero)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ifact = 1; ifact <= 2; ifact++ {\n\t\t\t\tif ifact == 1 {\n\t\t\t\t\tfact = 'F'\n\t\t\t\t} else {\n\t\t\t\t\tfact = 'N'\n\t\t\t\t}\n\n\t\t\t\t// Compute the condition number for comparison with\n\t\t\t\t// the value returned by DGTSVX.\n\t\t\t\tif zerot {\n\t\t\t\t\tif ifact == 1 {\n\t\t\t\t\t\tgoto label120\n\t\t\t\t\t}\n\t\t\t\t\trcondo = zero\n\t\t\t\t\trcondi = zero\n\n\t\t\t\t} else if ifact == 1 {\n\t\t\t\t\taf.Copy(n+2*m, a, 1, 1)\n\n\t\t\t\t\t// Compute the 1-norm and infinity-norm of A.\n\t\t\t\t\tanormo = golapack.Dlangt('1', n, a, a.Off(m), a.Off(n+m))\n\t\t\t\t\tanormi = golapack.Dlangt('I', n, a, a.Off(m), a.Off(n+m))\n\n\t\t\t\t\t// Factor the matrix A.\n\t\t\t\t\tif info, err = golapack.Dgttrf(n, af, af.Off(m), af.Off(n+m), af.Off(n+2*m), &iwork); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Use DGTTRS to solve for one column at a time of\n\t\t\t\t\t// inv(A), computing the maximum column sum as we go.\n\t\t\t\t\tainvnm = zero\n\t\t\t\t\tfor i = 1; i <= n; i++ {\n\t\t\t\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\t\t\t\tx.Set(j-1, zero)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx.Set(i-1, one)\n\t\t\t\t\t\tif err = golapack.Dgttrs(NoTrans, n, 1, af, af.Off(m), af.Off(n+m), af.Off(n+2*m), iwork, x.Matrix(lda, opts)); err != nil {\n\t\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tainvnm = math.Max(ainvnm, x.Asum(n, 1))\n\t\t\t\t\t}\n\n\t\t\t\t\t// Compute the 1-norm condition number of A.\n\t\t\t\t\tif anormo <= zero || ainvnm <= zero {\n\t\t\t\t\t\trcondo = one\n\t\t\t\t\t} else {\n\t\t\t\t\t\trcondo = (one / anormo) / ainvnm\n\t\t\t\t\t}\n\n\t\t\t\t\t// Use DGTTRS to solve for one column at a time of\n\t\t\t\t\t// inv(A'), computing the maximum column sum as we go.\n\t\t\t\t\tainvnm = zero\n\t\t\t\t\tfor i = 1; i <= n; i++ {\n\t\t\t\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\t\t\t\tx.Set(j-1, zero)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx.Set(i-1, one)\n\t\t\t\t\t\tif err = golapack.Dgttrs(Trans, n, 1, af, af.Off(m), af.Off(n+m), af.Off(n+2*m), iwork, x.Matrix(lda, opts)); err != nil {\n\t\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tainvnm = math.Max(ainvnm, x.Asum(n, 1))\n\t\t\t\t\t}\n\n\t\t\t\t\t// Compute the infinity-norm condition number of A.\n\t\t\t\t\tif anormi <= zero || ainvnm <= zero {\n\t\t\t\t\t\trcondi = one\n\t\t\t\t\t} else {\n\t\t\t\t\t\trcondi = (one / anormi) / ainvnm\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor _, trans = range mat.IterMatTrans() {\n\t\t\t\t\tif trans == NoTrans {\n\t\t\t\t\t\trcondc = rcondo\n\t\t\t\t\t} else {\n\t\t\t\t\t\trcondc = rcondi\n\t\t\t\t\t}\n\n\t\t\t\t\t// Generate NRHS random solution vectors.\n\t\t\t\t\tix = 1\n\t\t\t\t\tfor j = 1; j <= nrhs; j++ {\n\t\t\t\t\t\tgolapack.Dlarnv(2, &iseed, n, xact.Off(ix-1))\n\t\t\t\t\t\tix = ix + lda\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set the right hand side.\n\t\t\t\t\tgolapack.Dlagtm(trans, n, nrhs, one, a, a.Off(m), a.Off(n+m), xact.Matrix(lda, opts), zero, b.Matrix(lda, opts))\n\n\t\t\t\t\tif ifact == 2 && trans == NoTrans {\n\t\t\t\t\t\t// --- Test DGTSV ---\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Solve the system using Gaussian elimination with\n\t\t\t\t\t\t// partial pivoting.\n\t\t\t\t\t\taf.Copy(n+2*m, a, 1, 1)\n\t\t\t\t\t\tgolapack.Dlacpy(Full, n, nrhs, b.Matrix(lda, opts), x.Matrix(lda, opts))\n\n\t\t\t\t\t\t*srnamt = \"Dgtsv\"\n\t\t\t\t\t\tif info, err = golapack.Dgtsv(n, nrhs, af, af.Off(m), af.Off(n+m), x.Matrix(lda, opts)); err != nil {\n\t\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Check error code from DGTSV .\n\t\t\t\t\t\tif info != izero {\n\t\t\t\t\t\t\tnerrs = alaerh(path, \"Dgtsv\", info, 0, []byte(\" \"), n, n, 1, 1, nrhs, imat, nfail, nerrs)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnt = 1\n\t\t\t\t\t\tif izero == 0 {\n\t\t\t\t\t\t\t// Check residual of computed solution.\n\t\t\t\t\t\t\tgolapack.Dlacpy(Full, n, nrhs, b.Matrix(lda, opts), work.Matrix(lda, opts))\n\t\t\t\t\t\t\tresult.Set(1, dgtt02(trans, n, nrhs, a, a.Off(m), a.Off(n+m), x.Matrix(lda, opts), work.Matrix(lda, opts)))\n\n\t\t\t\t\t\t\t// Check solution from generated exact solution.\n\t\t\t\t\t\t\tresult.Set(2, dget04(n, nrhs, x.Matrix(lda, opts), xact.Matrix(lda, opts), rcondc))\n\t\t\t\t\t\t\tnt = 3\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Print information about the tests that did not pass\n\t\t\t\t\t\t// the threshold.\n\t\t\t\t\t\tfor k = 2; k <= nt; k++ {\n\t\t\t\t\t\t\tif result.Get(k-1) >= thresh {\n\t\t\t\t\t\t\t\tif nfail == 0 && nerrs == 0 {\n\t\t\t\t\t\t\t\t\taladhd(path)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tt.Fail()\n\t\t\t\t\t\t\t\tfmt.Printf(\" %s, N =%5d, _type %2d, test %2d, ratio = %12.5f\\n\", \"DGTSV \", n, imat, k, result.Get(k-1))\n\t\t\t\t\t\t\t\tnfail++\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnrun = nrun + nt - 1\n\t\t\t\t\t}\n\n\t\t\t\t\t// --- Test DGTSVX ---\n\t\t\t\t\tif ifact > 1 {\n\t\t\t\t\t\t// Initialize AF to zero.\n\t\t\t\t\t\tfor i = 1; i <= 3*n-2; i++ {\n\t\t\t\t\t\t\taf.Set(i-1, zero)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tgolapack.Dlaset(Full, n, nrhs, zero, zero, x.Matrix(lda, opts))\n\n\t\t\t\t\t// Solve the system and compute the condition number and\n\t\t\t\t\t// error bounds using DGTSVX.\n\t\t\t\t\t*srnamt = \"Dgtsvx\"\n\t\t\t\t\tif rcond, info, err = golapack.Dgtsvx(fact, trans, n, nrhs, a, a.Off(m), a.Off(n+m), af, af.Off(m), af.Off(n+m), af.Off(n+2*m), &iwork, b.Matrix(lda, opts), x.Matrix(lda, opts), rwork, rwork.Off(nrhs), work, toSlice(&iwork, n)); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check the error code from DGTSVX.\n\t\t\t\t\tif info != izero {\n\t\t\t\t\t\tnerrs = alaerh(path, \"Dgtsvx\", info, 0, []byte{fact, trans.Byte()}, n, n, 1, 1, nrhs, imat, nfail, nerrs)\n\t\t\t\t\t}\n\n\t\t\t\t\tif ifact >= 2 {\n\t\t\t\t\t\t// Reconstruct matrix from factors and compute\n\t\t\t\t\t\t// residual.\n\t\t\t\t\t\tresult.Set(0, dgtt01(n, a, a.Off(m), a.Off(n+m), af, af.Off(m), af.Off(n+m), af.Off(n+2*m), iwork, work.Matrix(lda, opts), rwork))\n\t\t\t\t\t\tk1 = 1\n\t\t\t\t\t} else {\n\t\t\t\t\t\tk1 = 2\n\t\t\t\t\t}\n\n\t\t\t\t\tif info == 0 {\n\t\t\t\t\t\t// Check residual of computed solution.\n\t\t\t\t\t\tgolapack.Dlacpy(Full, n, nrhs, b.Matrix(lda, opts), work.Matrix(lda, opts))\n\t\t\t\t\t\tresult.Set(1, dgtt02(trans, n, nrhs, a, a.Off(m), a.Off(n+m), x.Matrix(lda, opts), work.Matrix(lda, opts)))\n\n\t\t\t\t\t\t// Check solution from generated exact solution.\n\t\t\t\t\t\tresult.Set(2, dget04(n, nrhs, x.Matrix(lda, opts), xact.Matrix(lda, opts), rcondc))\n\n\t\t\t\t\t\t// Check the error bounds from iterative refinement.\n\t\t\t\t\t\tdgtt05(trans, n, nrhs, a, a.Off(m), a.Off(n+m), b.Matrix(lda, opts), x.Matrix(lda, opts), xact.Matrix(lda, opts), rwork, rwork.Off(nrhs), result.Off(3))\n\t\t\t\t\t\tnt = 5\n\t\t\t\t\t}\n\n\t\t\t\t\t// Print information about the tests that did not pass\n\t\t\t\t\t// the threshold.\n\t\t\t\t\tfor k = k1; k <= nt; k++ {\n\t\t\t\t\t\tif result.Get(k-1) >= thresh {\n\t\t\t\t\t\t\tif nfail == 0 && nerrs == 0 {\n\t\t\t\t\t\t\t\taladhd(path)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tt.Fail()\n\t\t\t\t\t\t\tfmt.Printf(\" %s, FACT='%c', TRANS=%s, N =%5d, _type %2d, test %2d, ratio = %12.5f\\n\", \"DGTSVX\", fact, trans, n, imat, k, result.Get(k-1))\n\t\t\t\t\t\t\tnfail++\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check the reciprocal of the condition number.\n\t\t\t\t\tresult.Set(5, dget06(rcond, rcondc))\n\t\t\t\t\tif result.Get(5) >= thresh {\n\t\t\t\t\t\tif nfail == 0 && nerrs == 0 {\n\t\t\t\t\t\t\taladhd(path)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tt.Fail()\n\t\t\t\t\t\tfmt.Printf(\" %s, FACT='%c', TRANS=%s, N =%5d, _type %2d, test %2d, ratio = %12.5f\\n\", \"DGTSVX\", fact, trans, n, imat, k, result.Get(k-1))\n\t\t\t\t\t\tnfail++\n\t\t\t\t\t}\n\t\t\t\t\tnrun = nrun + nt - k1 + 2\n\n\t\t\t\t}\n\t\t\tlabel120:\n\t\t\t}\n\t\tlabel130:\n\t\t}\n\t}\n\n\t// Verify number of tests match original.\n\ttgtRuns := 2033\n\tif nrun != tgtRuns {\n\t\tt.Fail()\n\t\tfmt.Printf(\" Number of tests do not match: got %v, want %v\\n\", nrun, tgtRuns)\n\t\tnerrs++\n\t}\n\n\t// Print a summary of the results.\n\t// alasvm(path, nfail, nrun, nerrs)\n\talasvmEnd(nfail, nrun, nerrs)\n}",
"func dsvdct(n int, s, e *mat.Vector, shift float64) (num int) {\n\tvar m1, m2, mx, one, ovfl, sov, sshift, ssun, sun, tmp, tom, u, unfl, zero float64\n\tvar i int\n\n\tone = 1.0\n\tzero = 0.0\n\n\t// Get machine constants\n\tunfl = 2 * golapack.Dlamch(SafeMinimum)\n\tovfl = one / unfl\n\n\t// Find largest entry\n\tmx = s.GetMag(0)\n\tfor i = 1; i <= n-1; i++ {\n\t\tmx = math.Max(mx, math.Max(s.GetMag(i), e.GetMag(i-1)))\n\t}\n\n\tif mx == zero {\n\t\tif shift < zero {\n\t\t\tnum = 0\n\t\t} else {\n\t\t\tnum = 2 * n\n\t\t}\n\t\treturn\n\t}\n\n\t// Compute scale factors as in Kahan's report\n\tsun = math.Sqrt(unfl)\n\tssun = math.Sqrt(sun)\n\tsov = math.Sqrt(ovfl)\n\ttom = ssun * sov\n\tif mx <= one {\n\t\tm1 = one / mx\n\t\tm2 = tom\n\t} else {\n\t\tm1 = one\n\t\tm2 = tom / mx\n\t}\n\n\t// Begin counting\n\tu = one\n\tnum = 0\n\tsshift = (shift * m1) * m2\n\tu = -sshift\n\tif u <= sun {\n\t\tif u <= zero {\n\t\t\tnum = num + 1\n\t\t\tif u > -sun {\n\t\t\t\tu = -sun\n\t\t\t}\n\t\t} else {\n\t\t\tu = sun\n\t\t}\n\t}\n\ttmp = (s.Get(0) * m1) * m2\n\tu = -tmp*(tmp/u) - sshift\n\tif u <= sun {\n\t\tif u <= zero {\n\t\t\tnum = num + 1\n\t\t\tif u > -sun {\n\t\t\t\tu = -sun\n\t\t\t}\n\t\t} else {\n\t\t\tu = sun\n\t\t}\n\t}\n\tfor i = 1; i <= n-1; i++ {\n\t\ttmp = (e.Get(i-1) * m1) * m2\n\t\tu = -tmp*(tmp/u) - sshift\n\t\tif u <= sun {\n\t\t\tif u <= zero {\n\t\t\t\tnum = num + 1\n\t\t\t\tif u > -sun {\n\t\t\t\t\tu = -sun\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tu = sun\n\t\t\t}\n\t\t}\n\t\ttmp = (s.Get(i) * m1) * m2\n\t\tu = -tmp*(tmp/u) - sshift\n\t\tif u <= sun {\n\t\t\tif u <= zero {\n\t\t\t\tnum = num + 1\n\t\t\t\tif u > -sun {\n\t\t\t\t\tu = -sun\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tu = sun\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}",
"func Ddst(n int, isgn int, a []float64, ip []int, w []float64) {\n\tvar j, nw, nc int\n\tvar xr float64\n\n\tnw = ip[0]\n\tif n > (nw << 2) {\n\t\tnw = n >> 2\n\t\tmakewt(nw, ip, w)\n\t}\n\tnc = ip[1]\n\tif n > nc {\n\t\tnc = n\n\t\tmakect(nc, ip, w[nw:])\n\t}\n\tif isgn < 0 {\n\t\txr = a[n-1]\n\t\tfor j = n - 2; j >= 2; j -= 2 {\n\t\t\ta[j+1] = -a[j] - a[j-1]\n\t\t\ta[j] -= a[j-1]\n\t\t}\n\t\ta[1] = a[0] + xr\n\t\ta[0] -= xr\n\t\tif n > 4 {\n\t\t\trftbsub(n, a, nc, w[nw:])\n\t\t\tcftbsub(n, a, ip, nw, w)\n\t\t} else if n == 4 {\n\t\t\tcftbsub(n, a, ip, nw, w)\n\t\t}\n\t}\n\tdstsub(n, a, nc, w[nw:])\n\tif isgn >= 0 {\n\t\tif n > 4 {\n\t\t\tcftfsub(n, a, ip, nw, w)\n\t\t\trftfsub(n, a, nc, w[nw:])\n\t\t} else if n == 4 {\n\t\t\tcftfsub(n, a, ip, nw, w)\n\t\t}\n\t\txr = a[0] - a[1]\n\t\ta[0] += a[1]\n\t\tfor j = 2; j < n; j += 2 {\n\t\t\ta[j-1] = -a[j] - a[j+1]\n\t\t\ta[j] -= a[j+1]\n\t\t}\n\t\ta[n-1] = -xr\n\t}\n}",
"func dsbt21(uplo mat.MatUplo, n, ka, ks int, a *mat.Matrix, d, e *mat.Vector, u *mat.Matrix, work, result *mat.Vector) {\n\tvar lower bool\n\tvar cuplo mat.MatUplo\n\tvar anorm, one, ulp, unfl, wnorm, zero float64\n\tvar ika, j, jc, jr, lw int\n\tvar err error\n\n\tzero = 0.0\n\tone = 1.0\n\n\t// Constants\n\tresult.Set(0, zero)\n\tresult.Set(1, zero)\n\tif n <= 0 {\n\t\treturn\n\t}\n\n\tika = max(0, min(n-1, ka))\n\tlw = (n * (n + 1)) / 2\n\n\tif uplo == Upper {\n\t\tlower = false\n\t\tcuplo = Upper\n\t} else {\n\t\tlower = true\n\t\tcuplo = Lower\n\t}\n\n\tunfl = golapack.Dlamch(SafeMinimum)\n\tulp = golapack.Dlamch(Epsilon) * golapack.Dlamch(Base)\n\n\t// Some Error Checks\n\t//\n\t// Do Test 1\n\t//\n\t// Norm of A:\n\tanorm = math.Max(golapack.Dlansb('1', cuplo, n, ika, a, work), unfl)\n\n\t// Compute error matrix: Error = A - U S U**T\n\t//\n\t// Copy A from SB to SP storage format.\n\tj = 0\n\tfor jc = 1; jc <= n; jc++ {\n\t\tif lower {\n\t\t\tfor jr = 1; jr <= min(ika+1, n+1-jc); jr++ {\n\t\t\t\tj = j + 1\n\t\t\t\twork.Set(j-1, a.Get(jr-1, jc-1))\n\t\t\t}\n\t\t\tfor jr = ika + 2; jr <= n+1-jc; jr++ {\n\t\t\t\tj = j + 1\n\t\t\t\twork.Set(j-1, zero)\n\t\t\t}\n\t\t} else {\n\t\t\tfor jr = ika + 2; jr <= jc; jr++ {\n\t\t\t\tj = j + 1\n\t\t\t\twork.Set(j-1, zero)\n\t\t\t}\n\t\t\tfor jr = min(ika, jc-1); jr >= 0; jr-- {\n\t\t\t\tj = j + 1\n\t\t\t\twork.Set(j-1, a.Get(ika+1-jr-1, jc-1))\n\t\t\t}\n\t\t}\n\t}\n\n\tfor j = 1; j <= n; j++ {\n\t\terr = work.Spr(cuplo, n, -d.Get(j-1), u.Off(0, j-1).Vector(), 1)\n\t}\n\n\tif n > 1 && ks == 1 {\n\t\tfor j = 1; j <= n-1; j++ {\n\t\t\terr = work.Spr2(cuplo, n, -e.Get(j-1), u.Off(0, j-1).Vector(), 1, u.Off(0, j).Vector(), 1)\n\t\t}\n\t}\n\twnorm = golapack.Dlansp('1', cuplo, n, work, work.Off(lw))\n\n\tif anorm > wnorm {\n\t\tresult.Set(0, (wnorm/anorm)/(float64(n)*ulp))\n\t} else {\n\t\tif anorm < one {\n\t\t\tresult.Set(0, (math.Min(wnorm, float64(n)*anorm)/anorm)/(float64(n)*ulp))\n\t\t} else {\n\t\t\tresult.Set(0, math.Min(wnorm/anorm, float64(n))/(float64(n)*ulp))\n\t\t}\n\t}\n\n\t// Do Test 2\n\t//\n\t// Compute U U**T - I\n\tif err = work.Matrix(n, opts).Gemm(NoTrans, ConjTrans, n, n, n, one, u, u, zero); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor j = 1; j <= n; j++ {\n\t\twork.Set((n+1)*(j-1), work.Get((n+1)*(j-1))-one)\n\t}\n\n\tresult.Set(1, math.Min(golapack.Dlange('1', n, n, work.Matrix(n, opts), work.Off(pow(n, 2))), float64(n))/(float64(n)*ulp))\n}",
"func Dtgsja(jobu, jobv, jobq byte, m, p, n, k, l int, a, b *mat.Matrix, tola, tolb float64, alpha, beta *mat.Vector, u, v, q *mat.Matrix, work *mat.Vector) (ncycle, info int, err error) {\n\tvar initq, initu, initv, upper, wantq, wantu, wantv bool\n\tvar a1, a2, a3, b1, b2, b3, csq, csu, csv, error, gamma, one, snq, snu, snv, ssmin, zero float64\n\tvar i, j, kcycle, maxit int\n\n\tmaxit = 40\n\tzero = 0.0\n\tone = 1.0\n\n\t// Decode and test the input parameters\n\tinitu = jobu == 'I'\n\twantu = initu || jobu == 'U'\n\n\tinitv = jobv == 'I'\n\twantv = initv || jobv == 'V'\n\n\tinitq = jobq == 'I'\n\twantq = initq || jobq == 'Q'\n\n\tif !(initu || wantu || jobu == 'N') {\n\t\terr = fmt.Errorf(\"!(initu || wantu || jobu == 'N'): jobu='%c'\", jobu)\n\t} else if !(initv || wantv || jobv == 'N') {\n\t\terr = fmt.Errorf(\"!(initv || wantv || jobv == 'N'): jobv='%c'\", jobv)\n\t} else if !(initq || wantq || jobq == 'N') {\n\t\terr = fmt.Errorf(\"!(initq || wantq || jobq == 'N'): jobq='%c'\", jobq)\n\t} else if m < 0 {\n\t\terr = fmt.Errorf(\"m < 0: m=%v\", m)\n\t} else if p < 0 {\n\t\terr = fmt.Errorf(\"p < 0: p=%v\", p)\n\t} else if n < 0 {\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if a.Rows < max(1, m) {\n\t\terr = fmt.Errorf(\"a.Rows < max(1, m): a.Rows=%v, m=%v\", a.Rows, m)\n\t} else if b.Rows < max(1, p) {\n\t\terr = fmt.Errorf(\"b.Rows < max(1, p): b.Rows=%v, p=%v\", b.Rows, p)\n\t} else if u.Rows < 1 || (wantu && u.Rows < m) {\n\t\terr = fmt.Errorf(\"u.Rows < 1 || (wantu && u.Rows < m): jobu='%c', u.Rows=%v, m=%v\", jobu, u.Rows, m)\n\t} else if v.Rows < 1 || (wantv && v.Rows < p) {\n\t\terr = fmt.Errorf(\"v.Rows < 1 || (wantv && v.Rows < p): jobv='%c', v.Rows=%v, p=%v\", jobv, v.Rows, p)\n\t} else if q.Rows < 1 || (wantq && q.Rows < n) {\n\t\terr = fmt.Errorf(\"q.Rows < 1 || (wantq && q.Rows < n): jobq='%c', q.Rows=%v, n=%v\", jobq, q.Rows, n)\n\t}\n\tif err != nil {\n\t\tgltest.Xerbla2(\"Dtgsja\", err)\n\t\treturn\n\t}\n\n\t// Initialize U, V and Q, if necessary\n\tif initu {\n\t\tDlaset(Full, m, m, zero, one, u)\n\t}\n\tif initv {\n\t\tDlaset(Full, p, p, zero, one, v)\n\t}\n\tif initq {\n\t\tDlaset(Full, n, n, zero, one, q)\n\t}\n\n\t// Loop until convergence\n\tupper = false\n\tfor kcycle = 1; kcycle <= maxit; kcycle++ {\n\n\t\tupper = !upper\n\n\t\tfor i = 1; i <= l-1; i++ {\n\t\t\tfor j = i + 1; j <= l; j++ {\n\n\t\t\t\ta1 = zero\n\t\t\t\ta2 = zero\n\t\t\t\ta3 = zero\n\t\t\t\tif k+i <= m {\n\t\t\t\t\ta1 = a.Get(k+i-1, n-l+i-1)\n\t\t\t\t}\n\t\t\t\tif k+j <= m {\n\t\t\t\t\ta3 = a.Get(k+j-1, n-l+j-1)\n\t\t\t\t}\n\n\t\t\t\tb1 = b.Get(i-1, n-l+i-1)\n\t\t\t\tb3 = b.Get(j-1, n-l+j-1)\n\n\t\t\t\tif upper {\n\t\t\t\t\tif k+i <= m {\n\t\t\t\t\t\ta2 = a.Get(k+i-1, n-l+j-1)\n\t\t\t\t\t}\n\t\t\t\t\tb2 = b.Get(i-1, n-l+j-1)\n\t\t\t\t} else {\n\t\t\t\t\tif k+j <= m {\n\t\t\t\t\t\ta2 = a.Get(k+j-1, n-l+i-1)\n\t\t\t\t\t}\n\t\t\t\t\tb2 = b.Get(j-1, n-l+i-1)\n\t\t\t\t}\n\n\t\t\t\tcsu, snu, csv, snv, csq, snq = Dlags2(upper, a1, a2, a3, b1, b2, b3)\n\n\t\t\t\t// Update (K+I)-th and (K+J)-th rows of matrix A: U**T *A\n\t\t\t\tif k+j <= m {\n\t\t\t\t\ta.Off(k+i-1, n-l).Vector().Rot(l, a.Off(k+j-1, n-l).Vector(), a.Rows, a.Rows, csu, snu)\n\t\t\t\t}\n\n\t\t\t\t// Update I-th and J-th rows of matrix B: V**T *B\n\t\t\t\tb.Off(i-1, n-l).Vector().Rot(l, b.Off(j-1, n-l).Vector(), b.Rows, b.Rows, csv, snv)\n\n\t\t\t\t// Update (N-L+I)-th and (N-L+J)-th columns of matrices\n\t\t\t\t// A and B: A*Q and B*Q\n\t\t\t\ta.Off(0, n-l+i-1).Vector().Rot(min(k+l, m), a.Off(0, n-l+j-1).Vector(), 1, 1, csq, snq)\n\n\t\t\t\tb.Off(0, n-l+i-1).Vector().Rot(l, b.Off(0, n-l+j-1).Vector(), 1, 1, csq, snq)\n\n\t\t\t\tif upper {\n\t\t\t\t\tif k+i <= m {\n\t\t\t\t\t\ta.Set(k+i-1, n-l+j-1, zero)\n\t\t\t\t\t}\n\t\t\t\t\tb.Set(i-1, n-l+j-1, zero)\n\t\t\t\t} else {\n\t\t\t\t\tif k+j <= m {\n\t\t\t\t\t\ta.Set(k+j-1, n-l+i-1, zero)\n\t\t\t\t\t}\n\t\t\t\t\tb.Set(j-1, n-l+i-1, zero)\n\t\t\t\t}\n\n\t\t\t\t// Update orthogonal matrices U, V, Q, if desired.\n\t\t\t\tif wantu && k+j <= m {\n\t\t\t\t\tu.Off(0, k+i-1).Vector().Rot(m, u.Off(0, k+j-1).Vector(), 1, 1, csu, snu)\n\t\t\t\t}\n\n\t\t\t\tif wantv {\n\t\t\t\t\tv.Off(0, i-1).Vector().Rot(p, v.Off(0, j-1).Vector(), 1, 1, csv, snv)\n\t\t\t\t}\n\n\t\t\t\tif wantq {\n\t\t\t\t\tq.Off(0, n-l+i-1).Vector().Rot(n, q.Off(0, n-l+j-1).Vector(), 1, 1, csq, snq)\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tif !upper {\n\t\t\t// The matrices A13 and B13 were lower triangular at the start\n\t\t\t// of the cycle, and are now upper triangular.\n\t\t\t//\n\t\t\t// Convergence test: test the parallelism of the corresponding\n\t\t\t// rows of A and B.\n\t\t\terror = zero\n\t\t\tfor i = 1; i <= min(l, m-k); i++ {\n\t\t\t\twork.Copy(l-i+1, a.Off(k+i-1, n-l+i-1).Vector(), a.Rows, 1)\n\t\t\t\twork.Off(l).Copy(l-i+1, b.Off(i-1, n-l+i-1).Vector(), b.Rows, 1)\n\t\t\t\tssmin = Dlapll(l-i+1, work, 1, work.Off(l), 1)\n\t\t\t\terror = math.Max(error, ssmin)\n\t\t\t}\n\n\t\t\tif math.Abs(error) <= math.Min(tola, tolb) {\n\t\t\t\tgoto label50\n\t\t\t}\n\t\t}\n\n\t\t// End of cycle loop\n\t}\n\n\t// The algorithm has not converged after MAXIT cycles.\n\tinfo = 1\n\tgoto label100\n\nlabel50:\n\t;\n\n\t// If ERROR <= MIN(TOLA,TOLB), then the algorithm has converged.\n\t// Compute the generalized singular value pairs (ALPHA, BETA), and\n\t// set the triangular matrix R to array A.\n\tfor i = 1; i <= k; i++ {\n\t\talpha.Set(i-1, one)\n\t\tbeta.Set(i-1, zero)\n\t}\n\n\tfor i = 1; i <= min(l, m-k); i++ {\n\n\t\ta1 = a.Get(k+i-1, n-l+i-1)\n\t\tb1 = b.Get(i-1, n-l+i-1)\n\n\t\tif a1 != zero {\n\t\t\tgamma = b1 / a1\n\n\t\t\t// change sign if necessary\n\t\t\tif gamma < zero {\n\t\t\t\tb.Off(i-1, n-l+i-1).Vector().Scal(l-i+1, -one, b.Rows)\n\t\t\t\tif wantv {\n\t\t\t\t\tv.Off(0, i-1).Vector().Scal(p, -one, 1)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t*beta.GetPtr(k + i - 1), *alpha.GetPtr(k + i - 1), _ = Dlartg(math.Abs(gamma), one)\n\n\t\t\tif alpha.Get(k+i-1) >= beta.Get(k+i-1) {\n\t\t\t\ta.Off(k+i-1, n-l+i-1).Vector().Scal(l-i+1, one/alpha.Get(k+i-1), a.Rows)\n\t\t\t} else {\n\t\t\t\tb.Off(i-1, n-l+i-1).Vector().Scal(l-i+1, one/beta.Get(k+i-1), b.Rows)\n\t\t\t\ta.Off(k+i-1, n-l+i-1).Vector().Copy(l-i+1, b.Off(i-1, n-l+i-1).Vector(), b.Rows, a.Rows)\n\t\t\t}\n\n\t\t} else {\n\n\t\t\talpha.Set(k+i-1, zero)\n\t\t\tbeta.Set(k+i-1, one)\n\t\t\ta.Off(k+i-1, n-l+i-1).Vector().Copy(l-i+1, b.Off(i-1, n-l+i-1).Vector(), b.Rows, a.Rows)\n\n\t\t}\n\n\t}\n\n\t// Post-assignment\n\tfor i = m + 1; i <= k+l; i++ {\n\t\talpha.Set(i-1, zero)\n\t\tbeta.Set(i-1, one)\n\t}\n\n\tif k+l < n {\n\t\tfor i = k + l + 1; i <= n; i++ {\n\t\t\talpha.Set(i-1, zero)\n\t\t\tbeta.Set(i-1, zero)\n\t\t}\n\t}\n\nlabel100:\n\t;\n\tncycle = kcycle\n\n\treturn\n}",
"func Dtgevc(side mat.MatSide, howmny byte, _select []bool, n int, s, p, vl, vr *mat.Matrix, mm int, work *mat.Vector) (m, info int, err error) {\n\tvar compl, compr, il2by2, ilabad, ilall, ilback, ilbbad, ilcomp, ilcplx, lsa, lsb bool\n\tvar acoef, acoefa, anorm, ascale, bcoefa, bcoefi, bcoefr, big, bignum, bnorm, bscale, cim2a, cim2b, cimaga, cimagb, cre2a, cre2b, creala, crealb, dmin, one, safety, safmin, salfar, sbeta, scale, small, temp, temp2, temp2i, temp2r, ulp, xmax, xscale, zero float64\n\tvar i, ibeg, ieig, iend, ihwmny, im, iside, j, ja, jc, je, jr, jw, na, nw int\n\n\tbdiag := vf(2)\n\tsum := mf(2, 2, opts)\n\tsump := mf(2, 2, opts)\n\tsums := mf(2, 2, opts)\n\n\tzero = 0.0\n\tone = 1.0\n\tsafety = 1.0e+2\n\n\t// Decode and Test the input parameters\n\tif howmny == 'A' {\n\t\tihwmny = 1\n\t\tilall = true\n\t\tilback = false\n\t} else if howmny == 'S' {\n\t\tihwmny = 2\n\t\tilall = false\n\t\tilback = false\n\t} else if howmny == 'B' {\n\t\tihwmny = 3\n\t\tilall = true\n\t\tilback = true\n\t} else {\n\t\tihwmny = -1\n\t\tilall = true\n\t}\n\n\tif side == Right {\n\t\tiside = 1\n\t\tcompl = false\n\t\tcompr = true\n\t} else if side == Left {\n\t\tiside = 2\n\t\tcompl = true\n\t\tcompr = false\n\t} else if side == Both {\n\t\tiside = 3\n\t\tcompl = true\n\t\tcompr = true\n\t} else {\n\t\tiside = -1\n\t}\n\n\tif iside < 0 {\n\t\terr = fmt.Errorf(\"iside < 0: side=%s\", side)\n\t} else if ihwmny < 0 {\n\t\terr = fmt.Errorf(\"ihwmny < 0: howmny='%c'\", howmny)\n\t} else if n < 0 {\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if s.Rows < max(1, n) {\n\t\terr = fmt.Errorf(\"s.Rows < max(1, n): s.Rows=%v, n=%v\", s.Rows, n)\n\t} else if p.Rows < max(1, n) {\n\t\terr = fmt.Errorf(\"p.Rows < max(1, n): p.Rows=%v, n=%v\", p.Rows, n)\n\t}\n\tif err != nil {\n\t\tgltest.Xerbla2(\"Dtgevc\", err)\n\t\treturn\n\t}\n\n\t// Count the number of eigenvectors to be computed\n\tif !ilall {\n\t\tim = 0\n\t\tilcplx = false\n\t\tfor j = 1; j <= n; j++ {\n\t\t\tif ilcplx {\n\t\t\t\tilcplx = false\n\t\t\t\tgoto label10\n\t\t\t}\n\t\t\tif j < n {\n\t\t\t\tif s.Get(j, j-1) != zero {\n\t\t\t\t\tilcplx = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ilcplx {\n\t\t\t\tif _select[j-1] || _select[j] {\n\t\t\t\t\tim = im + 2\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif _select[j-1] {\n\t\t\t\t\tim = im + 1\n\t\t\t\t}\n\t\t\t}\n\t\tlabel10:\n\t\t}\n\t} else {\n\t\tim = n\n\t}\n\n\t// Check 2-by-2 diagonal blocks of A, B\n\tilabad = false\n\tilbbad = false\n\tfor j = 1; j <= n-1; j++ {\n\t\tif s.Get(j, j-1) != zero {\n\t\t\tif p.Get(j-1, j-1) == zero || p.Get(j, j) == zero || p.Get(j-1, j) != zero {\n\t\t\t\tilbbad = true\n\t\t\t}\n\t\t\tif j < n-1 {\n\t\t\t\tif s.Get(j+2-1, j) != zero {\n\t\t\t\t\tilabad = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ilabad {\n\t\terr = fmt.Errorf(\"ilabad=%v\", ilabad)\n\t} else if ilbbad {\n\t\terr = fmt.Errorf(\"ilbbad=%v\", ilbbad)\n\t} else if compl && vl.Rows < n || vl.Rows < 1 {\n\t\terr = fmt.Errorf(\"compl && vl.Rows < n || vl.Rows < 1: compl=%v, vl.Rows=%v, n=%v\", compl, vl.Rows, n)\n\t} else if compr && vr.Rows < n || vr.Rows < 1 {\n\t\terr = fmt.Errorf(\"compr && vr.Rows < n || vr.Rows < 1: compr=%v, vr.Rows=%v, n=%v\", compr, vr.Rows, n)\n\t} else if mm < im {\n\t\terr = fmt.Errorf(\"mm < im: mm=%v, im=%v\", mm, im)\n\t}\n\tif err != nil {\n\t\tgltest.Xerbla2(\"Dtgevc\", err)\n\t\treturn\n\t}\n\n\t// Quick return if possible\n\tm = im\n\tif n == 0 {\n\t\treturn\n\t}\n\n\t// Machine Constants\n\tsafmin = Dlamch(SafeMinimum)\n\tbig = one / safmin\n\tsafmin, big = Dlabad(safmin, big)\n\tulp = Dlamch(Epsilon) * Dlamch(Base)\n\tsmall = safmin * float64(n) / ulp\n\tbig = one / small\n\tbignum = one / (safmin * float64(n))\n\n\t// Compute the 1-norm of each column of the strictly upper triangular\n\t// part (i.e., excluding all elements belonging to the diagonal\n\t// blocks) of A and B to check for possible overflow in the\n\t// triangular solver.\n\tanorm = math.Abs(s.Get(0, 0))\n\tif n > 1 {\n\t\tanorm = anorm + math.Abs(s.Get(1, 0))\n\t}\n\tbnorm = math.Abs(p.Get(0, 0))\n\twork.Set(0, zero)\n\twork.Set(n, zero)\n\n\tfor j = 2; j <= n; j++ {\n\t\ttemp = zero\n\t\ttemp2 = zero\n\t\tif s.Get(j-1, j-1-1) == zero {\n\t\t\tiend = j - 1\n\t\t} else {\n\t\t\tiend = j - 2\n\t\t}\n\t\tfor i = 1; i <= iend; i++ {\n\t\t\ttemp = temp + math.Abs(s.Get(i-1, j-1))\n\t\t\ttemp2 = temp2 + math.Abs(p.Get(i-1, j-1))\n\t\t}\n\t\twork.Set(j-1, temp)\n\t\twork.Set(n+j-1, temp2)\n\t\tfor i = iend + 1; i <= min(j+1, n); i++ {\n\t\t\ttemp = temp + math.Abs(s.Get(i-1, j-1))\n\t\t\ttemp2 = temp2 + math.Abs(p.Get(i-1, j-1))\n\t\t}\n\t\tanorm = math.Max(anorm, temp)\n\t\tbnorm = math.Max(bnorm, temp2)\n\t}\n\n\tascale = one / math.Max(anorm, safmin)\n\tbscale = one / math.Max(bnorm, safmin)\n\n\t// Left eigenvectors\n\tif compl {\n\t\tieig = 0\n\n\t\t// Main loop over eigenvalues\n\t\tilcplx = false\n\t\tfor je = 1; je <= n; je++ {\n\t\t\t// Skip this iteration if (a) HOWMNY='S' and SELECT=.FALSE., or\n\t\t\t// (b) this would be the second of a complex pair.\n\t\t\t// Check for complex eigenvalue, so as to be sure of which\n\t\t\t// entry(-ies) of SELECT to look at.\n\t\t\tif ilcplx {\n\t\t\t\tilcplx = false\n\t\t\t\tgoto label220\n\t\t\t}\n\t\t\tnw = 1\n\t\t\tif je < n {\n\t\t\t\tif s.Get(je, je-1) != zero {\n\t\t\t\t\tilcplx = true\n\t\t\t\t\tnw = 2\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ilall {\n\t\t\t\tilcomp = true\n\t\t\t} else if ilcplx {\n\t\t\t\tilcomp = _select[je-1] || _select[je]\n\t\t\t} else {\n\t\t\t\tilcomp = _select[je-1]\n\t\t\t}\n\t\t\tif !ilcomp {\n\t\t\t\tgoto label220\n\t\t\t}\n\n\t\t\t// Decide if (a) singular pencil, (b) real eigenvalue, or\n\t\t\t// (c) complex eigenvalue.\n\t\t\tif !ilcplx {\n\t\t\t\tif math.Abs(s.Get(je-1, je-1)) <= safmin && math.Abs(p.Get(je-1, je-1)) <= safmin {\n\t\t\t\t\t// Singular matrix pencil -- return unit eigenvector\n\t\t\t\t\tieig = ieig + 1\n\t\t\t\t\tfor jr = 1; jr <= n; jr++ {\n\t\t\t\t\t\tvl.Set(jr-1, ieig-1, zero)\n\t\t\t\t\t}\n\t\t\t\t\tvl.Set(ieig-1, ieig-1, one)\n\t\t\t\t\tgoto label220\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Clear vector\n\t\t\tfor jr = 1; jr <= nw*n; jr++ {\n\t\t\t\twork.Set(2*n+jr-1, zero)\n\t\t\t}\n\n\t\t\t// Compute coefficients in ( a A - b B ) y = 0\n\t\t\t// a is ACOEF\n\t\t\t// b is BCOEFR + i*BCOEFI\n\t\t\tif !ilcplx {\n\t\t\t\t// Real eigenvalue\n\t\t\t\ttemp = one / math.Max(math.Abs(s.Get(je-1, je-1))*ascale, math.Max(math.Abs(p.Get(je-1, je-1))*bscale, safmin))\n\t\t\t\tsalfar = (temp * s.Get(je-1, je-1)) * ascale\n\t\t\t\tsbeta = (temp * p.Get(je-1, je-1)) * bscale\n\t\t\t\tacoef = sbeta * ascale\n\t\t\t\tbcoefr = salfar * bscale\n\t\t\t\tbcoefi = zero\n\n\t\t\t\t// Scale to avoid underflow\n\t\t\t\tscale = one\n\t\t\t\tlsa = math.Abs(sbeta) >= safmin && math.Abs(acoef) < small\n\t\t\t\tlsb = math.Abs(salfar) >= safmin && math.Abs(bcoefr) < small\n\t\t\t\tif lsa {\n\t\t\t\t\tscale = (small / math.Abs(sbeta)) * math.Min(anorm, big)\n\t\t\t\t}\n\t\t\t\tif lsb {\n\t\t\t\t\tscale = math.Max(scale, (small/math.Abs(salfar))*math.Min(bnorm, big))\n\t\t\t\t}\n\t\t\t\tif lsa || lsb {\n\t\t\t\t\tscale = math.Min(scale, one/(safmin*math.Max(one, math.Max(math.Abs(acoef), math.Abs(bcoefr)))))\n\t\t\t\t\tif lsa {\n\t\t\t\t\t\tacoef = ascale * (scale * sbeta)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tacoef = scale * acoef\n\t\t\t\t\t}\n\t\t\t\t\tif lsb {\n\t\t\t\t\t\tbcoefr = bscale * (scale * salfar)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbcoefr = scale * bcoefr\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tacoefa = math.Abs(acoef)\n\t\t\t\tbcoefa = math.Abs(bcoefr)\n\n\t\t\t\t// First component is 1\n\t\t\t\twork.Set(2*n+je-1, one)\n\t\t\t\txmax = one\n\t\t\t} else {\n\t\t\t\t// Complex eigenvalue\n\t\t\t\tacoef, temp, bcoefr, temp2, bcoefi = Dlag2(s.Off(je-1, je-1), p.Off(je-1, je-1), safmin*safety)\n\t\t\t\tbcoefi = -bcoefi\n\t\t\t\tif bcoefi == zero {\n\t\t\t\t\tinfo = je\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Scale to avoid over/underflow\n\t\t\t\tacoefa = math.Abs(acoef)\n\t\t\t\tbcoefa = math.Abs(bcoefr) + math.Abs(bcoefi)\n\t\t\t\tscale = one\n\t\t\t\tif acoefa*ulp < safmin && acoefa >= safmin {\n\t\t\t\t\tscale = (safmin / ulp) / acoefa\n\t\t\t\t}\n\t\t\t\tif bcoefa*ulp < safmin && bcoefa >= safmin {\n\t\t\t\t\tscale = math.Max(scale, (safmin/ulp)/bcoefa)\n\t\t\t\t}\n\t\t\t\tif safmin*acoefa > ascale {\n\t\t\t\t\tscale = ascale / (safmin * acoefa)\n\t\t\t\t}\n\t\t\t\tif safmin*bcoefa > bscale {\n\t\t\t\t\tscale = math.Min(scale, bscale/(safmin*bcoefa))\n\t\t\t\t}\n\t\t\t\tif scale != one {\n\t\t\t\t\tacoef = scale * acoef\n\t\t\t\t\tacoefa = math.Abs(acoef)\n\t\t\t\t\tbcoefr = scale * bcoefr\n\t\t\t\t\tbcoefi = scale * bcoefi\n\t\t\t\t\tbcoefa = math.Abs(bcoefr) + math.Abs(bcoefi)\n\t\t\t\t}\n\n\t\t\t\t// Compute first two components of eigenvector\n\t\t\t\ttemp = acoef * s.Get(je, je-1)\n\t\t\t\ttemp2r = acoef*s.Get(je-1, je-1) - bcoefr*p.Get(je-1, je-1)\n\t\t\t\ttemp2i = -bcoefi * p.Get(je-1, je-1)\n\t\t\t\tif math.Abs(temp) > math.Abs(temp2r)+math.Abs(temp2i) {\n\t\t\t\t\twork.Set(2*n+je-1, one)\n\t\t\t\t\twork.Set(3*n+je-1, zero)\n\t\t\t\t\twork.Set(2*n+je, -temp2r/temp)\n\t\t\t\t\twork.Set(3*n+je, -temp2i/temp)\n\t\t\t\t} else {\n\t\t\t\t\twork.Set(2*n+je, one)\n\t\t\t\t\twork.Set(3*n+je, zero)\n\t\t\t\t\ttemp = acoef * s.Get(je-1, je)\n\t\t\t\t\twork.Set(2*n+je-1, (bcoefr*p.Get(je, je)-acoef*s.Get(je, je))/temp)\n\t\t\t\t\twork.Set(3*n+je-1, bcoefi*p.Get(je, je)/temp)\n\t\t\t\t}\n\t\t\t\txmax = math.Max(math.Abs(work.Get(2*n+je-1))+math.Abs(work.Get(3*n+je-1)), math.Abs(work.Get(2*n+je))+math.Abs(work.Get(3*n+je)))\n\t\t\t}\n\n\t\t\tdmin = math.Max(ulp*acoefa*anorm, math.Max(ulp*bcoefa*bnorm, safmin))\n\n\t\t\t// T\n\t\t\t// Triangular solve of (a A - b B) y = 0\n\t\t\t//\n\t\t\t// T\n\t\t\t// (rowwise in (a A - b B) , or columnwise in (a A - b B) )\n\t\t\til2by2 = false\n\n\t\t\tfor j = je + nw; j <= n; j++ {\n\t\t\t\tif il2by2 {\n\t\t\t\t\til2by2 = false\n\t\t\t\t\tgoto label160\n\t\t\t\t}\n\n\t\t\t\tna = 1\n\t\t\t\tbdiag.Set(0, p.Get(j-1, j-1))\n\t\t\t\tif j < n {\n\t\t\t\t\tif s.Get(j, j-1) != zero {\n\t\t\t\t\t\til2by2 = true\n\t\t\t\t\t\tbdiag.Set(1, p.Get(j, j))\n\t\t\t\t\t\tna = 2\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Check whether scaling is necessary for dot products\n\t\t\t\txscale = one / math.Max(one, xmax)\n\t\t\t\ttemp = math.Max(work.Get(j-1), math.Max(work.Get(n+j-1), acoefa*work.Get(j-1)+bcoefa*work.Get(n+j-1)))\n\t\t\t\tif il2by2 {\n\t\t\t\t\ttemp = math.Max(temp, math.Max(work.Get(j), math.Max(work.Get(n+j), acoefa*work.Get(j)+bcoefa*work.Get(n+j))))\n\t\t\t\t}\n\t\t\t\tif temp > bignum*xscale {\n\t\t\t\t\tfor jw = 0; jw <= nw-1; jw++ {\n\t\t\t\t\t\tfor jr = je; jr <= j-1; jr++ {\n\t\t\t\t\t\t\twork.Set((jw+2)*n+jr-1, xscale*work.Get((jw+2)*n+jr-1))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\txmax = xmax * xscale\n\t\t\t\t}\n\n\t\t\t\t// Compute dot products\n\t\t\t\t//\n\t\t\t\t// j-1\n\t\t\t\t// SUM = sum conjg( a*S(k,j) - b*P(k,j) )*x(k)\n\t\t\t\t// k=je\n\t\t\t\t//\n\t\t\t\t// To reduce the op count, this is done as\n\t\t\t\t//\n\t\t\t\t// _ j-1 _ j-1\n\t\t\t\t// a*conjg( sum S(k,j)*x(k) ) - b*conjg( sum P(k,j)*x(k) )\n\t\t\t\t// k=je k=je\n\t\t\t\t//\n\t\t\t\t// which may cause underflow problems if A or B are close\n\t\t\t\t// to underflow. (E.g., less than SMALL.)\n\t\t\t\tfor jw = 1; jw <= nw; jw++ {\n\t\t\t\t\tfor ja = 1; ja <= na; ja++ {\n\t\t\t\t\t\tsums.Set(ja-1, jw-1, zero)\n\t\t\t\t\t\tsump.Set(ja-1, jw-1, zero)\n\n\t\t\t\t\t\tfor jr = je; jr <= j-1; jr++ {\n\t\t\t\t\t\t\tsums.Set(ja-1, jw-1, sums.Get(ja-1, jw-1)+s.Get(jr-1, j+ja-1-1)*work.Get((jw+1)*n+jr-1))\n\t\t\t\t\t\t\tsump.Set(ja-1, jw-1, sump.Get(ja-1, jw-1)+p.Get(jr-1, j+ja-1-1)*work.Get((jw+1)*n+jr-1))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor ja = 1; ja <= na; ja++ {\n\t\t\t\t\tif ilcplx {\n\t\t\t\t\t\tsum.Set(ja-1, 0, -acoef*sums.Get(ja-1, 0)+bcoefr*sump.Get(ja-1, 0)-bcoefi*sump.Get(ja-1, 1))\n\t\t\t\t\t\tsum.Set(ja-1, 1, -acoef*sums.Get(ja-1, 1)+bcoefr*sump.Get(ja-1, 1)+bcoefi*sump.Get(ja-1, 0))\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsum.Set(ja-1, 0, -acoef*sums.Get(ja-1, 0)+bcoefr*sump.Get(ja-1, 0))\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// T\n\t\t\t\t// Solve ( a A - b B ) y = SUM(,)\n\t\t\t\t// with scaling and perturbation of the denominator\n\t\t\t\tscale, temp, _ = Dlaln2(true, na, nw, dmin, acoef, s.Off(j-1, j-1), bdiag.Get(0), bdiag.Get(1), sum, bcoefr, bcoefi, work.Off(2*n+j-1).Matrix(n, opts))\n\t\t\t\tif scale < one {\n\t\t\t\t\tfor jw = 0; jw <= nw-1; jw++ {\n\t\t\t\t\t\tfor jr = je; jr <= j-1; jr++ {\n\t\t\t\t\t\t\twork.Set((jw+2)*n+jr-1, scale*work.Get((jw+2)*n+jr-1))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\txmax = scale * xmax\n\t\t\t\t}\n\t\t\t\txmax = math.Max(xmax, temp)\n\t\t\tlabel160:\n\t\t\t}\n\n\t\t\t// Copy eigenvector to VL, back transforming if\n\t\t\t// HOWMNY='B'.\n\t\t\tieig = ieig + 1\n\t\t\tif ilback {\n\t\t\t\tfor jw = 0; jw <= nw-1; jw++ {\n\t\t\t\t\tif err = work.Off((jw+4)*n).Gemv(NoTrans, n, n+1-je, one, vl.Off(0, je-1), work.Off((jw+2)*n+je-1), 1, zero, 1); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tDlacpy(Full, n, nw, work.Off(4*n).Matrix(n, opts), vl.Off(0, je-1))\n\t\t\t\tibeg = 1\n\t\t\t} else {\n\t\t\t\tDlacpy(Full, n, nw, work.Off(2*n).Matrix(n, opts), vl.Off(0, ieig-1))\n\t\t\t\tibeg = je\n\t\t\t}\n\n\t\t\t// Scale eigenvector\n\t\t\txmax = zero\n\t\t\tif ilcplx {\n\t\t\t\tfor j = ibeg; j <= n; j++ {\n\t\t\t\t\txmax = math.Max(xmax, math.Abs(vl.Get(j-1, ieig-1))+math.Abs(vl.Get(j-1, ieig)))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor j = ibeg; j <= n; j++ {\n\t\t\t\t\txmax = math.Max(xmax, math.Abs(vl.Get(j-1, ieig-1)))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif xmax > safmin {\n\t\t\t\txscale = one / xmax\n\n\t\t\t\tfor jw = 0; jw <= nw-1; jw++ {\n\t\t\t\t\tfor jr = ibeg; jr <= n; jr++ {\n\t\t\t\t\t\tvl.Set(jr-1, ieig+jw-1, xscale*vl.Get(jr-1, ieig+jw-1))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tieig = ieig + nw - 1\n\n\t\tlabel220:\n\t\t}\n\t}\n\n\t// Right eigenvectors\n\tif compr {\n\t\tieig = im + 1\n\n\t\t// Main loop over eigenvalues\n\t\tilcplx = false\n\t\tfor je = n; je >= 1; je-- {\n\t\t\t// Skip this iteration if (a) HOWMNY='S' and SELECT=.FALSE., or\n\t\t\t// (b) this would be the second of a complex pair.\n\t\t\t// Check for complex eigenvalue, so as to be sure of which\n\t\t\t// entry(-ies) of SELECT to look at -- if complex, SELECT(JE)\n\t\t\t// or SELECT(JE-1).\n\t\t\t// If this is a complex pair, the 2-by-2 diagonal block\n\t\t\t// corresponding to the eigenvalue is in rows/columns JE-1:JE\n\t\t\tif ilcplx {\n\t\t\t\tilcplx = false\n\t\t\t\tgoto label500\n\t\t\t}\n\t\t\tnw = 1\n\t\t\tif je > 1 {\n\t\t\t\tif s.Get(je-1, je-1-1) != zero {\n\t\t\t\t\tilcplx = true\n\t\t\t\t\tnw = 2\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ilall {\n\t\t\t\tilcomp = true\n\t\t\t} else if ilcplx {\n\t\t\t\tilcomp = _select[je-1] || _select[je-1-1]\n\t\t\t} else {\n\t\t\t\tilcomp = _select[je-1]\n\t\t\t}\n\t\t\tif !ilcomp {\n\t\t\t\tgoto label500\n\t\t\t}\n\n\t\t\t// Decide if (a) singular pencil, (b) real eigenvalue, or\n\t\t\t// (c) complex eigenvalue.\n\t\t\tif !ilcplx {\n\t\t\t\tif math.Abs(s.Get(je-1, je-1)) <= safmin && math.Abs(p.Get(je-1, je-1)) <= safmin {\n\t\t\t\t\t// Singular matrix pencil -- unit eigenvector\n\t\t\t\t\tieig = ieig - 1\n\t\t\t\t\tfor jr = 1; jr <= n; jr++ {\n\t\t\t\t\t\tvr.Set(jr-1, ieig-1, zero)\n\t\t\t\t\t}\n\t\t\t\t\tvr.Set(ieig-1, ieig-1, one)\n\t\t\t\t\tgoto label500\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Clear vector\n\t\t\tfor jw = 0; jw <= nw-1; jw++ {\n\t\t\t\tfor jr = 1; jr <= n; jr++ {\n\t\t\t\t\twork.Set((jw+2)*n+jr-1, zero)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Compute coefficients in ( a A - b B ) x = 0\n\t\t\t// a is ACOEF\n\t\t\t// b is BCOEFR + i*BCOEFI\n\t\t\tif !ilcplx {\n\t\t\t\t// Real eigenvalue\n\t\t\t\ttemp = one / math.Max(math.Abs(s.Get(je-1, je-1))*ascale, math.Max(math.Abs(p.Get(je-1, je-1))*bscale, safmin))\n\t\t\t\tsalfar = (temp * s.Get(je-1, je-1)) * ascale\n\t\t\t\tsbeta = (temp * p.Get(je-1, je-1)) * bscale\n\t\t\t\tacoef = sbeta * ascale\n\t\t\t\tbcoefr = salfar * bscale\n\t\t\t\tbcoefi = zero\n\n\t\t\t\t// Scale to avoid underflow\n\t\t\t\tscale = one\n\t\t\t\tlsa = math.Abs(sbeta) >= safmin && math.Abs(acoef) < small\n\t\t\t\tlsb = math.Abs(salfar) >= safmin && math.Abs(bcoefr) < small\n\t\t\t\tif lsa {\n\t\t\t\t\tscale = (small / math.Abs(sbeta)) * math.Min(anorm, big)\n\t\t\t\t}\n\t\t\t\tif lsb {\n\t\t\t\t\tscale = math.Max(scale, (small/math.Abs(salfar))*math.Min(bnorm, big))\n\t\t\t\t}\n\t\t\t\tif lsa || lsb {\n\t\t\t\t\tscale = math.Min(scale, one/(safmin*math.Max(one, math.Max(math.Abs(acoef), math.Abs(bcoefr)))))\n\t\t\t\t\tif lsa {\n\t\t\t\t\t\tacoef = ascale * (scale * sbeta)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tacoef = scale * acoef\n\t\t\t\t\t}\n\t\t\t\t\tif lsb {\n\t\t\t\t\t\tbcoefr = bscale * (scale * salfar)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbcoefr = scale * bcoefr\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tacoefa = math.Abs(acoef)\n\t\t\t\tbcoefa = math.Abs(bcoefr)\n\n\t\t\t\t// First component is 1\n\t\t\t\twork.Set(2*n+je-1, one)\n\t\t\t\txmax = one\n\n\t\t\t\t// Compute contribution from column JE of A and B to sum\n\t\t\t\t// (See \"Further Details\", above.)\n\t\t\t\tfor jr = 1; jr <= je-1; jr++ {\n\t\t\t\t\twork.Set(2*n+jr-1, bcoefr*p.Get(jr-1, je-1)-acoef*s.Get(jr-1, je-1))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Complex eigenvalue\n\t\t\t\tacoef, temp, bcoefr, temp2, bcoefi = Dlag2(s.Off(je-1-1, je-1-1), p.Off(je-1-1, je-1-1), safmin*safety)\n\t\t\t\tif bcoefi == zero {\n\t\t\t\t\tinfo = je - 1\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Scale to avoid over/underflow\n\t\t\t\tacoefa = math.Abs(acoef)\n\t\t\t\tbcoefa = math.Abs(bcoefr) + math.Abs(bcoefi)\n\t\t\t\tscale = one\n\t\t\t\tif acoefa*ulp < safmin && acoefa >= safmin {\n\t\t\t\t\tscale = (safmin / ulp) / acoefa\n\t\t\t\t}\n\t\t\t\tif bcoefa*ulp < safmin && bcoefa >= safmin {\n\t\t\t\t\tscale = math.Max(scale, (safmin/ulp)/bcoefa)\n\t\t\t\t}\n\t\t\t\tif safmin*acoefa > ascale {\n\t\t\t\t\tscale = ascale / (safmin * acoefa)\n\t\t\t\t}\n\t\t\t\tif safmin*bcoefa > bscale {\n\t\t\t\t\tscale = math.Min(scale, bscale/(safmin*bcoefa))\n\t\t\t\t}\n\t\t\t\tif scale != one {\n\t\t\t\t\tacoef = scale * acoef\n\t\t\t\t\tacoefa = math.Abs(acoef)\n\t\t\t\t\tbcoefr = scale * bcoefr\n\t\t\t\t\tbcoefi = scale * bcoefi\n\t\t\t\t\tbcoefa = math.Abs(bcoefr) + math.Abs(bcoefi)\n\t\t\t\t}\n\n\t\t\t\t// Compute first two components of eigenvector\n\t\t\t\t// and contribution to sums\n\t\t\t\ttemp = acoef * s.Get(je-1, je-1-1)\n\t\t\t\ttemp2r = acoef*s.Get(je-1, je-1) - bcoefr*p.Get(je-1, je-1)\n\t\t\t\ttemp2i = -bcoefi * p.Get(je-1, je-1)\n\t\t\t\tif math.Abs(temp) >= math.Abs(temp2r)+math.Abs(temp2i) {\n\t\t\t\t\twork.Set(2*n+je-1, one)\n\t\t\t\t\twork.Set(3*n+je-1, zero)\n\t\t\t\t\twork.Set(2*n+je-1-1, -temp2r/temp)\n\t\t\t\t\twork.Set(3*n+je-1-1, -temp2i/temp)\n\t\t\t\t} else {\n\t\t\t\t\twork.Set(2*n+je-1-1, one)\n\t\t\t\t\twork.Set(3*n+je-1-1, zero)\n\t\t\t\t\ttemp = acoef * s.Get(je-1-1, je-1)\n\t\t\t\t\twork.Set(2*n+je-1, (bcoefr*p.Get(je-1-1, je-1-1)-acoef*s.Get(je-1-1, je-1-1))/temp)\n\t\t\t\t\twork.Set(3*n+je-1, bcoefi*p.Get(je-1-1, je-1-1)/temp)\n\t\t\t\t}\n\n\t\t\t\txmax = math.Max(math.Abs(work.Get(2*n+je-1))+math.Abs(work.Get(3*n+je-1)), math.Abs(work.Get(2*n+je-1-1))+math.Abs(work.Get(3*n+je-1-1)))\n\n\t\t\t\t// Compute contribution from columns JE and JE-1\n\t\t\t\t// of A and B to the sums.\n\t\t\t\tcreala = acoef * work.Get(2*n+je-1-1)\n\t\t\t\tcimaga = acoef * work.Get(3*n+je-1-1)\n\t\t\t\tcrealb = bcoefr*work.Get(2*n+je-1-1) - bcoefi*work.Get(3*n+je-1-1)\n\t\t\t\tcimagb = bcoefi*work.Get(2*n+je-1-1) + bcoefr*work.Get(3*n+je-1-1)\n\t\t\t\tcre2a = acoef * work.Get(2*n+je-1)\n\t\t\t\tcim2a = acoef * work.Get(3*n+je-1)\n\t\t\t\tcre2b = bcoefr*work.Get(2*n+je-1) - bcoefi*work.Get(3*n+je-1)\n\t\t\t\tcim2b = bcoefi*work.Get(2*n+je-1) + bcoefr*work.Get(3*n+je-1)\n\t\t\t\tfor jr = 1; jr <= je-2; jr++ {\n\t\t\t\t\twork.Set(2*n+jr-1, -creala*s.Get(jr-1, je-1-1)+crealb*p.Get(jr-1, je-1-1)-cre2a*s.Get(jr-1, je-1)+cre2b*p.Get(jr-1, je-1))\n\t\t\t\t\twork.Set(3*n+jr-1, -cimaga*s.Get(jr-1, je-1-1)+cimagb*p.Get(jr-1, je-1-1)-cim2a*s.Get(jr-1, je-1)+cim2b*p.Get(jr-1, je-1))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdmin = math.Max(ulp*acoefa*anorm, math.Max(ulp*bcoefa*bnorm, safmin))\n\n\t\t\t// Columnwise triangular solve of (a A - b B) x = 0\n\t\t\til2by2 = false\n\t\t\tfor j = je - nw; j >= 1; j-- {\n\t\t\t\t// If a 2-by-2 block, is in position j-1:j, wait until\n\t\t\t\t// next iteration to process it (when it will be j:j+1)\n\t\t\t\tif !il2by2 && j > 1 {\n\t\t\t\t\tif s.Get(j-1, j-1-1) != zero {\n\t\t\t\t\t\til2by2 = true\n\t\t\t\t\t\tgoto label370\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbdiag.Set(0, p.Get(j-1, j-1))\n\t\t\t\tif il2by2 {\n\t\t\t\t\tna = 2\n\t\t\t\t\tbdiag.Set(1, p.Get(j, j))\n\t\t\t\t} else {\n\t\t\t\t\tna = 1\n\t\t\t\t}\n\n\t\t\t\t// Compute x(j) (and x(j+1), if 2-by-2 block)\n\t\t\t\tscale, temp, _ = Dlaln2(false, na, nw, dmin, acoef, s.Off(j-1, j-1), bdiag.Get(0), bdiag.Get(1), work.Off(2*n+j-1).Matrix(n, opts), bcoefr, bcoefi, sum)\n\t\t\t\tif scale < one {\n\n\t\t\t\t\tfor jw = 0; jw <= nw-1; jw++ {\n\t\t\t\t\t\tfor jr = 1; jr <= je; jr++ {\n\t\t\t\t\t\t\twork.Set((jw+2)*n+jr-1, scale*work.Get((jw+2)*n+jr-1))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\txmax = math.Max(scale*xmax, temp)\n\n\t\t\t\tfor jw = 1; jw <= nw; jw++ {\n\t\t\t\t\tfor ja = 1; ja <= na; ja++ {\n\t\t\t\t\t\twork.Set((jw+1)*n+j+ja-1-1, sum.Get(ja-1, jw-1))\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// w = w + x(j)*(a S(*,j) - b P(*,j) ) with scaling\n\t\t\t\tif j > 1 {\n\t\t\t\t\t// Check whether scaling is necessary for sum.\n\t\t\t\t\txscale = one / math.Max(one, xmax)\n\t\t\t\t\ttemp = acoefa*work.Get(j-1) + bcoefa*work.Get(n+j-1)\n\t\t\t\t\tif il2by2 {\n\t\t\t\t\t\ttemp = math.Max(temp, acoefa*work.Get(j)+bcoefa*work.Get(n+j))\n\t\t\t\t\t}\n\t\t\t\t\ttemp = math.Max(temp, math.Max(acoefa, bcoefa))\n\t\t\t\t\tif temp > bignum*xscale {\n\n\t\t\t\t\t\tfor jw = 0; jw <= nw-1; jw++ {\n\t\t\t\t\t\t\tfor jr = 1; jr <= je; jr++ {\n\t\t\t\t\t\t\t\twork.Set((jw+2)*n+jr-1, xscale*work.Get((jw+2)*n+jr-1))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\txmax = xmax * xscale\n\t\t\t\t\t}\n\n\t\t\t\t\t// Compute the contributions of the off-diagonals of\n\t\t\t\t\t// column j (and j+1, if 2-by-2 block) of A and B to the\n\t\t\t\t\t// sums.\n\t\t\t\t\tfor ja = 1; ja <= na; ja++ {\n\t\t\t\t\t\tif ilcplx {\n\t\t\t\t\t\t\tcreala = acoef * work.Get(2*n+j+ja-1-1)\n\t\t\t\t\t\t\tcimaga = acoef * work.Get(3*n+j+ja-1-1)\n\t\t\t\t\t\t\tcrealb = bcoefr*work.Get(2*n+j+ja-1-1) - bcoefi*work.Get(3*n+j+ja-1-1)\n\t\t\t\t\t\t\tcimagb = bcoefi*work.Get(2*n+j+ja-1-1) + bcoefr*work.Get(3*n+j+ja-1-1)\n\t\t\t\t\t\t\tfor jr = 1; jr <= j-1; jr++ {\n\t\t\t\t\t\t\t\twork.Set(2*n+jr-1, work.Get(2*n+jr-1)-creala*s.Get(jr-1, j+ja-1-1)+crealb*p.Get(jr-1, j+ja-1-1))\n\t\t\t\t\t\t\t\twork.Set(3*n+jr-1, work.Get(3*n+jr-1)-cimaga*s.Get(jr-1, j+ja-1-1)+cimagb*p.Get(jr-1, j+ja-1-1))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcreala = acoef * work.Get(2*n+j+ja-1-1)\n\t\t\t\t\t\t\tcrealb = bcoefr * work.Get(2*n+j+ja-1-1)\n\t\t\t\t\t\t\tfor jr = 1; jr <= j-1; jr++ {\n\t\t\t\t\t\t\t\twork.Set(2*n+jr-1, work.Get(2*n+jr-1)-creala*s.Get(jr-1, j+ja-1-1)+crealb*p.Get(jr-1, j+ja-1-1))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\til2by2 = false\n\t\t\tlabel370:\n\t\t\t}\n\n\t\t\t// Copy eigenvector to VR, back transforming if\n\t\t\t// HOWMNY='B'.\n\t\t\tieig = ieig - nw\n\t\t\tif ilback {\n\n\t\t\t\tfor jw = 0; jw <= nw-1; jw++ {\n\t\t\t\t\tfor jr = 1; jr <= n; jr++ {\n\t\t\t\t\t\twork.Set((jw+4)*n+jr-1, work.Get((jw+2)*n)*vr.Get(jr-1, 0))\n\t\t\t\t\t}\n\n\t\t\t\t\t// A series of compiler directives to defeat\n\t\t\t\t\t// vectorization for the next loop\n\t\t\t\t\tfor jc = 2; jc <= je; jc++ {\n\t\t\t\t\t\tfor jr = 1; jr <= n; jr++ {\n\t\t\t\t\t\t\twork.Set((jw+4)*n+jr-1, work.Get((jw+4)*n+jr-1)+work.Get((jw+2)*n+jc-1)*vr.Get(jr-1, jc-1))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor jw = 0; jw <= nw-1; jw++ {\n\t\t\t\t\tfor jr = 1; jr <= n; jr++ {\n\t\t\t\t\t\tvr.Set(jr-1, ieig+jw-1, work.Get((jw+4)*n+jr-1))\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tiend = n\n\t\t\t} else {\n\t\t\t\tfor jw = 0; jw <= nw-1; jw++ {\n\t\t\t\t\tfor jr = 1; jr <= n; jr++ {\n\t\t\t\t\t\tvr.Set(jr-1, ieig+jw-1, work.Get((jw+2)*n+jr-1))\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tiend = je\n\t\t\t}\n\n\t\t\t// Scale eigenvector\n\t\t\txmax = zero\n\t\t\tif ilcplx {\n\t\t\t\tfor j = 1; j <= iend; j++ {\n\t\t\t\t\txmax = math.Max(xmax, math.Abs(vr.Get(j-1, ieig-1))+math.Abs(vr.Get(j-1, ieig)))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor j = 1; j <= iend; j++ {\n\t\t\t\t\txmax = math.Max(xmax, math.Abs(vr.Get(j-1, ieig-1)))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif xmax > safmin {\n\t\t\t\txscale = one / xmax\n\t\t\t\tfor jw = 0; jw <= nw-1; jw++ {\n\t\t\t\t\tfor jr = 1; jr <= iend; jr++ {\n\t\t\t\t\t\tvr.Set(jr-1, ieig+jw-1, xscale*vr.Get(jr-1, ieig+jw-1))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tlabel500:\n\t\t}\n\t}\n\n\treturn\n}",
"func dget37(rmax *mat.Vector, lmax, ninfo *[]int) (knt int) {\n\tvar bignum, eps, epsin, one, smlnum, tnrm, tol, tolin, two, v, vimin, vmax, vmul, vrmin, zero float64\n\tvar _i, i, icmp, ifnd, info, iscl, j, kmin, ldt, lwork, n int\n\tvar err error\n\n\tcnt := 0\n\tzero = 0.0\n\tone = 1.0\n\ttwo = 2.0\n\tepsin = 5.9605e-8\n\tldt = 20\n\tlwork = 2 * ldt * (10 + ldt)\n\t_select := make([]bool, 20)\n\tdum := vf(1)\n\ts := vf(20)\n\tsep := vf(20)\n\tsepin := vf(20)\n\tseptmp := vf(20)\n\tsin := vf(20)\n\tstmp := vf(20)\n\tval := vf(3)\n\twi := vf(20)\n\twiin := vf(20)\n\twitmp := vf(20)\n\twork := vf(lwork)\n\twr := vf(20)\n\twrin := vf(20)\n\twrtmp := vf(20)\n\tiwork := make([]int, lwork)\n\tlcmp := make([]int, 3)\n\tle := mf(20, 20, opts)\n\tre := mf(20, 20, opts)\n\tt := mf(20, 20, opts)\n\ttmp := mf(20, 20, opts)\n\n\teps = golapack.Dlamch(Precision)\n\tsmlnum = golapack.Dlamch(SafeMinimum) / eps\n\tbignum = one / smlnum\n\tsmlnum, bignum = golapack.Dlabad(smlnum, bignum)\n\n\t// EPSIN = 2**(-24) = precision to which input data computed\n\teps = math.Max(eps, epsin)\n\trmax.Set(0, zero)\n\trmax.Set(1, zero)\n\trmax.Set(2, zero)\n\t(*lmax)[0] = 0\n\t(*lmax)[1] = 0\n\t(*lmax)[2] = 0\n\tknt = 0\n\t(*ninfo)[0] = 0\n\t(*ninfo)[1] = 0\n\t(*ninfo)[2] = 0\n\n\tval.Set(0, math.Sqrt(smlnum))\n\tval.Set(1, one)\n\tval.Set(2, math.Sqrt(bignum))\n\n\tnlist := []int{1, 1, 2, 2, 2, 6, 4, 5, 5, 6, 6, 6, 4, 6, 5, 10, 4, 6, 10, 4, 6, 4, 3, 6, 6, 6, 6, 6, 12, 6, 6, 6, 6, 8, 6, 4, 5, 6, 10}\n\ttmplist := [][]float64{\n\t\t{\n\t\t\t0.0000e+00,\n\t\t},\n\t\t{\n\t\t\t1.0000e+00,\n\t\t},\n\t\t{\n\t\t\t0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00,\n\t\t},\n\t\t{\n\t\t\t3.0000e+00, 2.0000e+00,\n\t\t\t2.0000e+00, 3.0000e+00,\n\t\t},\n\t\t{\n\t\t\t3.0000e+00, -2.0000e+00,\n\t\t\t2.0000e+00, 3.0000e+00,\n\t\t},\n\t\t{\n\t\t\t1.0000e-07, -1.0000e-07, 1.0000e+00, 1.1000e+00, 2.3000e+00, 3.7000e+00,\n\t\t\t3.0000e-07, 1.0000e-07, 1.0000e+00, 1.0000e+00, -1.3000e+00, -7.7000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 3.0000e-07, 1.0000e-07, 2.2000e+00, 3.3000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, -1.0000e-07, 3.0000e-07, 1.8000e+00, 1.6000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 4.0000e-06, 5.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 3.0000e+00, 4.0000e-06,\n\t\t},\n\t\t{\n\t\t\t7.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00,\n\t\t\t-1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00,\n\t\t\t-1.0000e+00, 1.0000e+00, 5.0000e+00, -3.0000e+00,\n\t\t\t1.0000e+00, -1.0000e+00, 3.0000e+00, 3.0000e+00,\n\t\t},\n\t\t{\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t},\n\t\t{\n\t\t\t1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00,\n\t\t},\n\t\t{\n\t\t\t1.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 1.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 1.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 1.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 1.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00,\n\t\t},\n\t\t{\n\t\t\t1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t1.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 1.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 1.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 1.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 1.0000e+00,\n\t\t},\n\t\t{\n\t\t\t1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 2.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 3.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 4.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 5.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 6.0000e+00,\n\t\t},\n\t\t{\n\t\t\t9.4480e-01, 6.7670e-01, 6.9080e-01, 5.9650e-01,\n\t\t\t5.8760e-01, 8.6420e-01, 6.7690e-01, 7.2600e-02,\n\t\t\t7.2560e-01, 1.9430e-01, 9.6870e-01, 2.8310e-01,\n\t\t\t2.8490e-01, 5.8000e-02, 4.8450e-01, 7.3610e-01,\n\t\t},\n\t\t{\n\t\t\t5.0410e-01, 6.6520e-01, 7.7190e-01, 6.3870e-01, 5.9550e-01, 6.1310e-01,\n\t\t\t1.5740e-01, 3.7340e-01, 5.9840e-01, 1.5470e-01, 9.4270e-01, 6.5900e-02,\n\t\t\t4.4170e-01, 7.2300e-02, 1.5440e-01, 5.4920e-01, 8.7000e-03, 3.0040e-01,\n\t\t\t2.0080e-01, 6.0800e-01, 3.0340e-01, 8.4390e-01, 2.3900e-01, 5.7680e-01,\n\t\t\t9.3610e-01, 7.4130e-01, 1.4440e-01, 1.7860e-01, 1.4280e-01, 7.2630e-01,\n\t\t\t5.5990e-01, 9.3360e-01, 7.8000e-02, 4.0930e-01, 6.7140e-01, 5.6170e-01,\n\t\t},\n\t\t{\n\t\t\t2.0000e-03, 1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 1.0000e-03, 1.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, -1.0000e-03, 1.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, -2.0000e-03, 1.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t},\n\t\t{\n\t\t\t4.8630e-01, 9.1260e-01, 2.1900e-02, 6.0110e-01, 1.4050e-01, 2.0840e-01, 8.2640e-01, 8.4410e-01, 3.1420e-01, 8.6750e-01,\n\t\t\t7.1500e-01, 2.6480e-01, 8.8510e-01, 2.6150e-01, 5.9520e-01, 4.7800e-01, 7.6730e-01, 4.6110e-01, 5.7320e-01, 7.7000e-03,\n\t\t\t2.1210e-01, 5.5080e-01, 5.2350e-01, 3.0810e-01, 6.6020e-01, 2.8900e-01, 2.3140e-01, 2.2790e-01, 9.6600e-02, 1.0910e-01,\n\t\t\t7.1510e-01, 8.5790e-01, 5.7710e-01, 5.1140e-01, 1.9010e-01, 9.0810e-01, 6.0090e-01, 7.1980e-01, 1.0640e-01, 8.6840e-01,\n\t\t\t5.6800e-01, 2.8100e-02, 4.0140e-01, 6.3150e-01, 1.1480e-01, 7.5800e-02, 9.4230e-01, 7.2030e-01, 3.6850e-01, 1.7430e-01,\n\t\t\t7.7210e-01, 3.0280e-01, 5.5640e-01, 9.9980e-01, 3.6520e-01, 5.2580e-01, 3.7030e-01, 6.7790e-01, 9.9350e-01, 5.0270e-01,\n\t\t\t7.3960e-01, 4.5600e-02, 7.4740e-01, 9.2880e-01, 2.2000e-03, 8.2600e-02, 3.6340e-01, 4.9120e-01, 9.4050e-01, 3.8910e-01,\n\t\t\t5.6370e-01, 8.5540e-01, 3.2100e-02, 2.6380e-01, 3.6090e-01, 6.4970e-01, 8.4690e-01, 9.3500e-01, 3.7000e-02, 2.9170e-01,\n\t\t\t8.6560e-01, 6.3270e-01, 3.5620e-01, 6.3560e-01, 2.7360e-01, 6.5120e-01, 1.0220e-01, 2.8880e-01, 5.7620e-01, 4.0790e-01,\n\t\t\t5.3320e-01, 4.1210e-01, 7.2870e-01, 2.3110e-01, 6.8300e-01, 7.3860e-01, 8.1800e-01, 9.8150e-01, 8.0550e-01, 2.5660e-01,\n\t\t},\n\t\t{\n\t\t\t-3.8730e-01, 3.6560e-01, 3.1200e-02, -5.8340e-01,\n\t\t\t5.5230e-01, -1.1854e+00, 9.8330e-01, 7.6670e-01,\n\t\t\t1.6746e+00, -1.9900e-02, -1.8293e+00, 5.7180e-01,\n\t\t\t-5.2500e-01, 3.5340e-01, -2.7210e-01, -8.8300e-02,\n\t\t},\n\t\t{\n\t\t\t-1.0777e+00, 1.7027e+00, 2.6510e-01, 8.5160e-01, 1.0121e+00, 2.5710e-01,\n\t\t\t-1.3400e-02, 3.9030e-01, -1.2680e+00, 2.7530e-01, -3.2350e-01, -1.3844e+00,\n\t\t\t1.5230e-01, 3.0680e-01, 8.7330e-01, -3.3410e-01, -4.8310e-01, -1.5416e+00,\n\t\t\t1.4470e-01, -6.0570e-01, 3.1900e-02, -1.0905e+00, -8.3700e-02, 6.2410e-01,\n\t\t\t-7.6510e-01, -1.7889e+00, -1.5069e+00, -6.0210e-01, 5.2170e-01, 6.4700e-01,\n\t\t\t8.1940e-01, 2.1100e-01, 5.4320e-01, 7.5610e-01, 1.7130e-01, 5.5400e-01,\n\t\t},\n\t\t{\n\t\t\t-1.0639e+00, 1.6120e-01, 1.5620e-01, 3.4360e-01, -6.7480e-01, 1.6598e+00, 6.4650e-01, -7.8630e-01, -2.6100e-01, 7.0190e-01,\n\t\t\t-8.4400e-01, -2.2439e+00, 1.8800e+00, -1.0005e+00, 7.4500e-02, -1.6156e+00, 2.8220e-01, 8.5600e-01, 1.3497e+00, -1.5883e+00,\n\t\t\t1.5988e+00, 1.1758e+00, 1.2398e+00, 1.1173e+00, 2.1500e-01, 4.3140e-01, 1.8500e-01, 7.9470e-01, 6.6260e-01, 8.6460e-01,\n\t\t\t-2.2960e-01, 1.2442e+00, 2.3242e+00, -5.0690e-01, -7.5160e-01, -5.4370e-01, -2.5990e-01, 1.2830e+00, -1.1067e+00, -1.1150e-01,\n\t\t\t-3.6040e-01, 4.0420e-01, 6.1240e-01, -1.2164e+00, -9.4650e-01, -3.1460e-01, 1.8310e-01, 7.3710e-01, 1.4278e+00, 2.9220e-01,\n\t\t\t4.6150e-01, 3.8740e-01, -4.2900e-02, -9.3600e-01, 7.1160e-01, -8.2590e-01, -1.7640e+00, -9.4660e-01, 1.8202e+00, -2.5480e-01,\n\t\t\t1.2934e+00, -9.7550e-01, 6.7480e-01, -1.0481e+00, -1.8442e+00, -5.4600e-02, 7.4050e-01, 6.1000e-03, 1.2430e+00, -1.8490e-01,\n\t\t\t-3.4710e-01, -9.5800e-01, 1.6530e-01, 9.1300e-02, -5.2010e-01, -1.1832e+00, 8.5410e-01, -2.3200e-01, -1.6155e+00, 5.5180e-01,\n\t\t\t1.0190e+00, -6.8240e-01, 8.0850e-01, 2.5950e-01, -3.7580e-01, -1.8825e+00, 1.6473e+00, -6.5920e-01, 8.0250e-01, -4.9000e-03,\n\t\t\t1.2670e+00, -4.2400e-02, 8.9570e-01, -1.6770e-01, 1.4620e-01, 9.8800e-01, -2.3170e-01, -1.4483e+00, -5.8200e-02, 1.9700e-02,\n\t\t},\n\t\t{\n\t\t\t-1.2298e+00, -2.3142e+00, -6.9800e-02, 1.0523e+00,\n\t\t\t2.0390e-01, -1.2298e+00, 8.0500e-02, 9.7860e-01,\n\t\t\t0.0000e+00, 0.0000e+00, 2.5600e-01, -8.9100e-01,\n\t\t\t0.0000e+00, 0.0000e+00, 2.7480e-01, 2.5600e-01,\n\t\t},\n\t\t{\n\t\t\t5.9930e-01, 1.9372e+00, -1.6160e-01, -1.4602e+00, 6.0180e-01, 2.7120e+00,\n\t\t\t-2.2049e+00, 5.9930e-01, -1.0679e+00, 1.9405e+00, -1.4400e+00, -2.2110e-01,\n\t\t\t0.0000e+00, 0.0000e+00, -2.4567e+00, -6.8650e-01, -1.9101e+00, 6.4960e-01,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 7.3620e-01, 3.9700e-01, -1.5190e-01,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, -1.0034e+00, 1.1954e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, -1.3400e-01, -1.0034e+00,\n\t\t},\n\t\t{\n\t\t\t1.0000e-04, 1.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, -1.0000e-04, 1.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 1.0000e-02, 1.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, -5.0000e-03,\n\t\t},\n\t\t{\n\t\t\t2.0000e-06, 1.0000e+00, -2.0000e+00,\n\t\t\t1.0000e-06, -2.0000e+00, 4.0000e+00,\n\t\t\t0.0000e+00, 1.0000e+00, -2.0000e+00,\n\t\t},\n\t\t{\n\t\t\t2.4080e-01, 6.5530e-01, 9.1660e-01, 5.0300e-02, 2.8490e-01, 2.4080e-01,\n\t\t\t6.9070e-01, 9.7000e-01, 1.4020e-01, 5.7820e-01, 6.7670e-01, 6.9070e-01,\n\t\t\t1.0620e-01, 3.8000e-02, 7.0540e-01, 2.4320e-01, 8.6420e-01, 1.0620e-01,\n\t\t\t2.6400e-01, 9.8800e-02, 1.7800e-02, 9.4480e-01, 1.9430e-01, 2.6400e-01,\n\t\t\t7.0340e-01, 2.5600e-01, 2.6110e-01, 5.8760e-01, 5.8000e-02, 7.0340e-01,\n\t\t\t4.0210e-01, 5.5980e-01, 1.3580e-01, 7.2560e-01, 6.9080e-01, 4.0210e-01,\n\t\t},\n\t\t{\n\t\t\t3.4800e+00, -2.9900e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t-4.9000e-01, 2.4800e+00, -1.9900e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, -4.9000e-01, 1.4800e+00, -9.9000e-01, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, -9.9000e-01, 1.4800e+00, -4.9000e-01, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, -1.9900e+00, 2.4800e+00, -4.9000e-01,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, -2.9900e+00, 3.4800e+00,\n\t\t},\n\t\t{\n\t\t\t0.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00,\n\t\t\t1.0000e+00, 0.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 1.0000e+00, 0.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 1.0000e+00, 0.0000e+00, 1.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 0.0000e+00, 1.0000e+00,\n\t\t\t-1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 0.0000e+00,\n\t\t},\n\t\t{\n\t\t\t3.5345e-01, 9.3023e-01, 7.4679e-02, -1.0059e-02, 4.6698e-02, -4.3480e-02,\n\t\t\t9.3545e-01, -3.5147e-01, -2.8216e-02, 3.8008e-03, -1.7644e-02, 1.6428e-02,\n\t\t\t0.0000e+00, -1.0555e-01, 7.5211e-01, -1.0131e-01, 4.7030e-01, -4.3789e-01,\n\t\t\t0.0000e+00, 0.0000e+00, 6.5419e-01, 1.1779e-01, -5.4678e-01, 5.0911e-01,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, -9.8780e-01, -1.1398e-01, 1.0612e-01,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 6.8144e-01, 7.3187e-01,\n\t\t},\n\t\t{\n\t\t\t1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00,\n\t\t\t5.0000e-01, 3.3330e-01, 2.5000e-01, 2.0000e-01, 1.6670e-01, 1.4290e-01,\n\t\t\t3.3330e-01, 2.5000e-01, 2.0000e-01, 1.6670e-01, 1.4290e-01, 1.2500e-01,\n\t\t\t2.5000e-01, 2.0000e-01, 1.6670e-01, 1.4290e-01, 1.2500e-01, 1.1110e-01,\n\t\t\t2.0000e-01, 1.6670e-01, 1.4290e-01, 1.2500e-01, 1.1110e-01, 1.0000e-01,\n\t\t\t1.6670e-01, 1.4290e-01, 1.2500e-01, 1.1110e-01, 1.0000e-01, 9.0900e-02,\n\t\t},\n\t\t{\n\t\t\t1.2000e+01, 1.1000e+01, 1.0000e+01, 9.0000e+00, 8.0000e+00, 7.0000e+00, 6.0000e+00, 5.0000e+00, 4.0000e+00, 3.0000e+00, 2.0000e+00, 1.0000e+00,\n\t\t\t1.1000e+01, 1.1000e+01, 1.0000e+01, 9.0000e+00, 8.0000e+00, 7.0000e+00, 6.0000e+00, 5.0000e+00, 4.0000e+00, 3.0000e+00, 2.0000e+00, 1.0000e+00,\n\t\t\t0.0000e+00, 1.0000e+01, 1.0000e+01, 9.0000e+00, 8.0000e+00, 7.0000e+00, 6.0000e+00, 5.0000e+00, 4.0000e+00, 3.0000e+00, 2.0000e+00, 1.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 9.0000e+00, 9.0000e+00, 8.0000e+00, 7.0000e+00, 6.0000e+00, 5.0000e+00, 4.0000e+00, 3.0000e+00, 2.0000e+00, 1.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 8.0000e+00, 8.0000e+00, 7.0000e+00, 6.0000e+00, 5.0000e+00, 4.0000e+00, 3.0000e+00, 2.0000e+00, 1.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 7.0000e+00, 7.0000e+00, 6.0000e+00, 5.0000e+00, 4.0000e+00, 3.0000e+00, 2.0000e+00, 1.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 6.0000e+00, 6.0000e+00, 5.0000e+00, 4.0000e+00, 3.0000e+00, 2.0000e+00, 1.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 5.0000e+00, 5.0000e+00, 4.0000e+00, 3.0000e+00, 2.0000e+00, 1.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 4.0000e+00, 4.0000e+00, 3.0000e+00, 2.0000e+00, 1.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 3.0000e+00, 3.0000e+00, 2.0000e+00, 1.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 2.0000e+00, 2.0000e+00, 1.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 1.0000e+00,\n\t\t},\n\t\t{\n\t\t\t0.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t5.0000e+00, 0.0000e+00, 2.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 4.0000e+00, 0.0000e+00, 3.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 3.0000e+00, 0.0000e+00, 4.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 2.0000e+00, 0.0000e+00, 5.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 0.0000e+00,\n\t\t},\n\t\t{\n\t\t\t1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00,\n\t\t\t-1.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00,\n\t\t\t-1.0000e+00, -1.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00,\n\t\t\t-1.0000e+00, -1.0000e+00, -1.0000e+00, 1.0000e+00, 0.0000e+00, 1.0000e+00,\n\t\t\t-1.0000e+00, -1.0000e+00, -1.0000e+00, -1.0000e+00, 1.0000e+00, 1.0000e+00,\n\t\t\t-1.0000e+00, -1.0000e+00, -1.0000e+00, -1.0000e+00, -1.0000e+00, 1.0000e+00,\n\t\t},\n\t\t{\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00,\n\t\t\t1.0000e+00, 1.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 1.0000e+00,\n\t\t\t0.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 0.0000e+00, 1.0000e+00,\n\t\t\t1.0000e+00, 0.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00,\n\t\t\t1.0000e+00, 0.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 1.0000e+00, 0.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00,\n\t\t},\n\t\t{\n\t\t\t1.0000e+00, 4.0112e+00, 1.2750e+01, 4.0213e+01, 1.2656e+02, 3.9788e+02,\n\t\t\t1.0000e+00, 3.2616e+00, 1.0629e+01, 3.3342e+01, 1.0479e+02, 3.2936e+02,\n\t\t\t1.0000e+00, 3.1500e+00, 9.8006e+00, 3.0630e+01, 9.6164e+01, 3.0215e+02,\n\t\t\t1.0000e+00, 3.2755e+00, 1.0420e+01, 3.2957e+01, 1.0374e+02, 3.2616e+02,\n\t\t\t1.0000e+00, 2.8214e+00, 8.4558e+00, 2.6296e+01, 8.2443e+01, 2.5893e+02,\n\t\t\t1.0000e+00, 2.6406e+00, 8.3565e+00, 2.6558e+01, 8.3558e+01, 2.6268e+02,\n\t\t},\n\t\t{\n\t\t\t0.0000e+00, 4.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t1.0000e+00, 0.0000e+00, 4.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 1.0000e+00, 0.0000e+00, 4.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 1.0000e+00, 0.0000e+00, 4.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 0.0000e+00, 4.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 0.0000e+00, 4.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 0.0000e+00, 4.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 0.0000e+00,\n\t\t},\n\t\t{\n\t\t\t8.5000e+00, -1.0472e+01, 2.8944e+00, -1.5279e+00, 1.1056e+00, -5.0000e-01,\n\t\t\t2.6180e+00, -1.1708e+00, -2.0000e+00, 8.9440e-01, -6.1800e-01, 2.7640e-01,\n\t\t\t-7.2360e-01, 2.0000e+00, -1.7080e-01, -1.6180e+00, 8.9440e-01, -3.8200e-01,\n\t\t\t3.8200e-01, -8.9440e-01, 1.6180e+00, 1.7080e-01, -2.0000e+00, 7.2360e-01,\n\t\t\t-2.7640e-01, 6.1800e-01, -8.9440e-01, 2.0000e+00, 1.1708e+00, -2.6180e+00,\n\t\t\t5.0000e-01, -1.1056e+00, 1.5279e+00, -2.8944e+00, 1.0472e+01, -8.5000e+00,\n\t\t},\n\t\t{\n\t\t\t4.0000e+00, -5.0000e+00, 0.0000e+00, 3.0000e+00,\n\t\t\t0.0000e+00, 4.0000e+00, -3.0000e+00, -5.0000e+00,\n\t\t\t5.0000e+00, -3.0000e+00, 4.0000e+00, 0.0000e+00,\n\t\t\t3.0000e+00, 0.0000e+00, 5.0000e+00, 4.0000e+00,\n\t\t},\n\t\t{\n\t\t\t1.5000e+01, 1.1000e+01, 6.0000e+00, -9.0000e+00, -1.5000e+01,\n\t\t\t1.0000e+00, 3.0000e+00, 9.0000e+00, -3.0000e+00, -8.0000e+00,\n\t\t\t7.0000e+00, 6.0000e+00, 6.0000e+00, -3.0000e+00, -1.1000e+01,\n\t\t\t7.0000e+00, 7.0000e+00, 5.0000e+00, -3.0000e+00, -1.1000e+01,\n\t\t\t1.7000e+01, 1.2000e+01, 5.0000e+00, -1.0000e+01, -1.6000e+01,\n\t\t},\n\t\t{\n\t\t\t-9.0000e+00, 2.1000e+01, -1.5000e+01, 4.0000e+00, 2.0000e+00, 0.0000e+00,\n\t\t\t-1.0000e+01, 2.1000e+01, -1.4000e+01, 4.0000e+00, 2.0000e+00, 0.0000e+00,\n\t\t\t-8.0000e+00, 1.6000e+01, -1.1000e+01, 4.0000e+00, 2.0000e+00, 0.0000e+00,\n\t\t\t-6.0000e+00, 1.2000e+01, -9.0000e+00, 3.0000e+00, 3.0000e+00, 0.0000e+00,\n\t\t\t-4.0000e+00, 8.0000e+00, -6.0000e+00, 0.0000e+00, 5.0000e+00, 0.0000e+00,\n\t\t\t-2.0000e+00, 4.0000e+00, -3.0000e+00, 0.0000e+00, 1.0000e+00, 3.0000e+00,\n\t\t},\n\t\t{\n\t\t\t1.0000e+00, 1.0000e+00, 1.0000e+00, -2.0000e+00, 1.0000e+00, -1.0000e+00, 2.0000e+00, -2.0000e+00, 4.0000e+00, -3.0000e+00,\n\t\t\t-1.0000e+00, 2.0000e+00, 3.0000e+00, -4.0000e+00, 2.0000e+00, -2.0000e+00, 4.0000e+00, -4.0000e+00, 8.0000e+00, -6.0000e+00,\n\t\t\t-1.0000e+00, 0.0000e+00, 5.0000e+00, -5.0000e+00, 3.0000e+00, -3.0000e+00, 6.0000e+00, -6.0000e+00, 1.2000e+01, -9.0000e+00,\n\t\t\t-1.0000e+00, 0.0000e+00, 3.0000e+00, -4.0000e+00, 4.0000e+00, -4.0000e+00, 8.0000e+00, -8.0000e+00, 1.6000e+01, -1.2000e+01,\n\t\t\t-1.0000e+00, 0.0000e+00, 3.0000e+00, -6.0000e+00, 5.0000e+00, -4.0000e+00, 1.0000e+01, -1.0000e+01, 2.0000e+01, -1.5000e+01,\n\t\t\t-1.0000e+00, 0.0000e+00, 3.0000e+00, -6.0000e+00, 2.0000e+00, -2.0000e+00, 1.2000e+01, -1.2000e+01, 2.4000e+01, -1.8000e+01,\n\t\t\t-1.0000e+00, 0.0000e+00, 3.0000e+00, -6.0000e+00, 2.0000e+00, -5.0000e+00, 1.5000e+01, -1.3000e+01, 2.8000e+01, -2.1000e+01,\n\t\t\t-1.0000e+00, 0.0000e+00, 3.0000e+00, -6.0000e+00, 2.0000e+00, -5.0000e+00, 1.2000e+01, -1.1000e+01, 3.2000e+01, -2.4000e+01,\n\t\t\t-1.0000e+00, 0.0000e+00, 3.0000e+00, -6.0000e+00, 2.0000e+00, -5.0000e+00, 1.2000e+01, -1.4000e+01, 3.7000e+01, -2.6000e+01,\n\t\t\t-1.0000e+00, 0.0000e+00, 3.0000e+00, -6.0000e+00, 2.0000e+00, -5.0000e+00, 1.2000e+01, -1.4000e+01, 3.6000e+01, -2.5000e+01,\n\t\t},\n\t}\n\twrinlist := [][]float64{\n\t\t{0.0000e+00},\n\t\t{1.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00},\n\t\t{1.0000e+00, 5.0000e+00},\n\t\t{3.0000e+00, 3.0000e+00},\n\t\t{-3.8730e+00, 1.0000e-07, 1.0000e-07, 3.0000e-07, 3.0000e-07, 3.8730e+00},\n\t\t{3.9603e+00, 3.9603e+00, 4.0397e+00, 4.0397e+00},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00},\n\t\t{1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00},\n\t\t{1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00},\n\t\t{1.0000e+00, 2.0000e+00, 3.0000e+00, 4.0000e+00, 5.0000e+00, 6.0000e+00},\n\t\t{2.4326e-01, 2.4326e-01, 7.4091e-01, 2.2864e+00},\n\t\t{-5.2278e-01, -3.5380e-01, -8.0876e-03, 3.4760e-01, 3.4760e-01, 2.7698e+00},\n\t\t{-2.0000e-03, -1.0000e-03, 0.0000e+00, 1.0000e-03, 2.0000e-03},\n\t\t{-4.6121e-01, -4.6121e-01, -4.5164e-01, -1.4922e-01, -1.4922e-01, 3.3062e-02, 3.0849e-01, 3.0849e-01, 5.4509e-01, 5.0352e+00},\n\t\t{-1.8952e+00, -1.8952e+00, -9.5162e-02, 3.9520e-01},\n\t\t{-1.7029e+00, -1.0307e+00, 2.8487e-01, 2.8487e-01, 1.1675e+00, 1.1675e+00},\n\t\t{-2.6992e+00, -2.6992e+00, -2.4366e+00, -1.2882e+00, -1.2882e+00, 9.0275e-01, 9.0442e-01, 9.0442e-01, 1.6774e+00, 3.0060e+00},\n\t\t{-1.2298e+00, -1.2298e+00, 2.5600e-01, 2.5600e-01},\n\t\t{-2.4567e+00, -1.0034e+00, -1.0034e+00, 5.9930e-01, 5.9930e-01, 7.3620e-01},\n\t\t{-5.0000e-03, -1.0000e-04, 1.0000e-04, 1.0000e-02},\n\t\t{-4.0000e+00, 0.0000e+00, 2.2096e-06},\n\t\t{-3.4008e-01, -3.4008e-01, -1.6998e-07, 7.2311e-01, 7.2311e-01, 2.5551e+00},\n\t\t{1.3034e-02, 1.1294e+00, 2.0644e+00, 2.8388e+00, 4.3726e+00, 4.4618e+00},\n\t\t{-1.7321e+00, -1.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e+00, 1.7321e+00},\n\t\t{-9.9980e-01, -9.9980e-01, 7.4539e-01, 7.4539e-01, 9.9929e-01, 9.9929e-01},\n\t\t{-2.2135e-01, -3.1956e-02, -8.5031e-04, -5.8584e-05, 1.3895e-05, 2.1324e+00},\n\t\t{-2.8234e-02, 7.2587e-02, 7.2587e-02, 1.8533e-01, 2.8828e-01, 6.4315e-01, 1.5539e+00, 3.5119e+00, 6.9615e+00, 1.2311e+01, 2.0199e+01, 3.2229e+01},\n\t\t{-5.0000e+00, -3.0000e+00, -1.0000e+00, 1.0000e+00, 3.0000e+00, 5.0000e+00},\n\t\t{8.0298e-02, 8.0298e-02, 1.4415e+00, 1.4415e+00, 1.4782e+00, 1.4782e+00},\n\t\t{-3.5343e-02, -3.5343e-02, 5.8440e-07, 6.4087e-01, 6.4087e-01, 3.7889e+00},\n\t\t{-5.3220e-01, -1.0118e-01, -9.8749e-03, 2.9861e-03, 1.8075e-01, 3.9260e+02},\n\t\t{-3.7588e+00, -3.0642e+00, -2.0000e+00, -6.9459e-01, 6.9459e-01, 2.0000e+00, 3.0642e+00, 3.7588e+00},\n\t\t{-5.8930e-01, -2.7627e-01, -2.7627e-01, 2.7509e-01, 2.7509e-01, 5.9167e-01},\n\t\t{1.0000e+00, 1.0000e+00, 2.0000e+00, 1.2000e+01},\n\t\t{-9.9999e-01, 1.4980e+00, 1.4980e+00, 1.5020e+00, 1.5020e+00},\n\t\t{1.0000e+00, 1.0000e+00, 2.0000e+00, 2.0000e+00, 3.0000e+00, 3.0000e+00},\n\t\t{1.0000e+00, 1.9867e+00, 2.0000e+00, 2.0000e+00, 2.0067e+00, 2.0067e+00, 2.9970e+00, 3.0000e+00, 3.0000e+00, 3.0030e+00},\n\t}\n\twiinlist := [][]float64{\n\t\t{0.0000e+00},\n\t\t{0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00},\n\t\t{2.0000e+00, -2.0000e+00},\n\t\t{0.0000e+00, 1.7321e-07, -1.7321e-07, 1.0000e-07, -1.0000e-07, 0.0000e+00},\n\t\t{4.0425e-02, -4.0425e-02, 3.8854e-02, -3.8854e-02},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{2.1409e-01, -2.1409e-01, 0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 3.0525e-01, -3.0525e-01, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{7.2657e-01, -7.2657e-01, 0.0000e+00, 4.8255e-01, -4.8255e-01, 0.0000e+00, 1.1953e-01, -1.1953e-01, 0.0000e+00, 0.0000e+00},\n\t\t{7.5059e-01, -7.5059e-01, 0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 1.2101e+00, -1.2101e+00, 4.6631e-01, -4.6631e-01},\n\t\t{9.0387e-01, -9.0387e-01, 0.0000e+00, 8.8930e-01, -8.8930e-01, 0.0000e+00, 2.5661e+00, -2.5661e+00, 0.0000e+00, 0.0000e+00},\n\t\t{6.8692e-01, -6.8692e-01, 4.9482e-01, -4.9482e-01},\n\t\t{0.0000e+00, 4.0023e-01, -4.0023e-01, 2.0667e+00, -2.0667e+00, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{3.2133e-01, -3.2133e-01, 0.0000e+00, 5.9389e-02, -5.9389e-02, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{1.9645e-02, -1.9645e-02, 6.6663e-01, -6.6663e-01, 3.7545e-02, -3.7545e-02},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 9.0746e-02, -9.0746e-02, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{2.4187e+00, -2.4187e+00, 6.2850e-01, -6.2850e-01, 1.5638e-01, -1.5638e-01},\n\t\t{7.4812e-01, -7.4812e-01, 0.0000e+00, 7.2822e-01, -7.2822e-01, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 4.9852e-01, -4.9852e-01, 5.0059e-01, -5.0059e-01, 0.0000e+00},\n\t\t{5.0000e+00, -5.0000e+00, 0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 3.5752e+00, -3.5752e+00, 3.5662e+00, -3.5662e+00},\n\t\t{6.2559e-04, -6.2559e-04, 1.0001e+00, -1.0001e+00, 0.0000e+00, 0.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00, 2.5052e-03, -2.5052e-03, 1.1763e-02, -1.1763e-02, 0.0000e+00, 8.7028e-04, -8.7028e-04, 0.0000e+00},\n\t}\n\tsinlist := [][]float64{\n\t\t{1.0000e+00},\n\t\t{1.0000e+00},\n\t\t{1.0000e+00, 1.0000e+00},\n\t\t{1.0000e+00, 1.0000e+00},\n\t\t{1.0000e+00, 1.0000e+00},\n\t\t{6.9855e-01, 9.7611e-08, 9.7611e-08, 1.0000e-07, 1.0000e-07, 4.0659e-01},\n\t\t{1.1244e-05, 1.1244e-05, 1.0807e-05, 1.0807e-05},\n\t\t{1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00},\n\t\t{1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00},\n\t\t{2.4074e-35, 2.4074e-35, 2.4074e-35, 2.4074e-35, 2.4074e-35, 2.4074e-35},\n\t\t{2.4074e-35, 2.4074e-35, 2.4074e-35, 2.4074e-35, 2.4074e-35, 2.4074e-35},\n\t\t{1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00},\n\t\t{8.7105e-01, 8.7105e-01, 9.8194e-01, 9.7723e-01},\n\t\t{2.7888e-01, 3.5427e-01, 3.4558e-01, 5.4661e-01, 5.4661e-01, 9.6635e-01},\n\t\t{2.4000e-11, 6.0000e-12, 4.0000e-12, 6.0000e-12, 2.4000e-11},\n\t\t{4.7781e-01, 4.7781e-01, 4.6034e-01, 4.7500e-01, 4.7500e-01, 2.9729e-01, 4.2947e-01, 4.2947e-01, 7.0777e-01, 9.7257e-01},\n\t\t{8.1913e-01, 8.1913e-01, 8.0499e-01, 9.8222e-01},\n\t\t{6.7909e-01, 7.2671e-01, 3.9757e-01, 3.9757e-01, 4.2334e-01, 4.2334e-01},\n\t\t{6.4005e-01, 6.4005e-01, 6.9083e-01, 5.3435e-01, 5.3435e-01, 2.9802e-01, 7.3193e-01, 7.3193e-01, 3.0743e-01, 8.5623e-01},\n\t\t{4.7136e-01, 4.7136e-01, 8.0960e-01, 8.0960e-01},\n\t\t{4.7091e-01, 3.6889e-01, 3.6889e-01, 5.8849e-01, 5.8849e-01, 6.0845e-01},\n\t\t{3.7485e-07, 9.8979e-09, 1.0098e-08, 1.4996e-06},\n\t\t{7.3030e-01, 7.2801e-01, 8.2763e-01},\n\t\t{5.7839e-01, 5.7839e-01, 4.9641e-01, 7.0039e-01, 7.0039e-01, 9.2518e-01},\n\t\t{7.5301e-01, 6.0479e-01, 5.4665e-01, 4.2771e-01, 6.6370e-01, 5.7388e-01},\n\t\t{8.6603e-01, 5.0000e-01, 2.9582e-31, 2.9582e-31, 5.0000e-01, 8.6603e-01},\n\t\t{1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00},\n\t\t{4.0841e-01, 3.7927e-01, 6.2793e-01, 8.1156e-01, 9.7087e-01, 8.4325e-01},\n\t\t{2.8690e-06, 1.5885e-06, 1.5885e-06, 6.5757e-07, 1.8324e-06, 6.8640e-05, 4.6255e-03, 1.4447e-01, 5.8447e-01, 3.1823e-01, 2.0079e-01, 3.0424e-01},\n\t\t{8.2295e-01, 7.2281e-01, 6.2854e-01, 6.2854e-01, 7.2281e-01, 8.2295e-01},\n\t\t{8.9968e-01, 8.9968e-01, 9.6734e-01, 9.6734e-01, 9.7605e-01, 9.7605e-01},\n\t\t{3.9345e-01, 3.9345e-01, 2.8868e-01, 4.5013e-01, 4.5013e-01, 9.6305e-01},\n\t\t{5.3287e-01, 7.2342e-01, 7.3708e-01, 4.4610e-01, 4.2881e-01, 4.8057e-01},\n\t\t{1.2253e-01, 4.9811e-02, 3.6914e-02, 3.3328e-02, 3.3328e-02, 3.6914e-02, 4.9811e-02, 1.2253e-01},\n\t\t{1.7357e-04, 1.7486e-04, 1.7486e-04, 1.7635e-04, 1.7635e-04, 1.7623e-04},\n\t\t{1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00},\n\t\t{2.1768e-01, 3.9966e-04, 3.9966e-04, 3.9976e-04, 3.9976e-04},\n\t\t{6.4875e-05, 6.4875e-05, 5.4076e-02, 5.4076e-02, 8.6149e-01, 1.2425e-01},\n\t\t{3.6037e-02, 7.4283e-05, 1.4346e-04, 1.4346e-04, 6.7873e-05, 6.7873e-05, 9.2779e-05, 2.7358e-04, 2.7358e-04, 9.2696e-05},\n\t}\n\tsepinlist := [][]float64{\n\t\t{0.0000e+00},\n\t\t{1.0000e+00},\n\t\t{0.0000e+00, 0.0000e+00},\n\t\t{4.0000e+00, 4.0000e+00},\n\t\t{4.0000e+00, 4.0000e+00},\n\t\t{2.2823e+00, 5.0060e-14, 5.0060e-14, 9.4094e-14, 9.4094e-14, 1.5283e+00},\n\t\t{3.1179e-05, 3.1179e-05, 2.9981e-05, 2.9981e-05},\n\t\t{1.9722e-31, 1.9722e-31, 1.9722e-31, 1.9722e-31, 1.9722e-31},\n\t\t{1.9722e-31, 1.9722e-31, 1.9722e-31, 1.9722e-31, 1.9722e-31},\n\t\t{2.4074e-35, 2.4074e-35, 2.4074e-35, 2.4074e-35, 2.4074e-35, 2.4074e-35},\n\t\t{2.4074e-35, 2.4074e-35, 2.4074e-35, 2.4074e-35, 2.4074e-35, 2.4074e-35},\n\t\t{1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00, 1.0000e+00},\n\t\t{3.5073e-01, 3.5073e-01, 4.6989e-01, 1.5455e+00},\n\t\t{1.1793e-01, 6.8911e-02, 1.3489e-01, 1.7729e-01, 1.7729e-01, 1.8270e+00},\n\t\t{2.3952e-11, 5.9940e-12, 3.9920e-12, 5.9940e-12, 2.3952e-11},\n\t\t{1.5842e-01, 1.5842e-01, 1.9931e-01, 9.1686e-02, 9.1686e-02, 8.2469e-02, 3.9688e-02, 3.9688e-02, 1.5033e-01, 3.5548e+00},\n\t\t{7.7090e-01, 7.7090e-01, 4.9037e-01, 4.9037e-01},\n\t\t{6.7220e-01, 2.0436e-01, 4.9797e-01, 4.9797e-01, 1.9048e-01, 1.9048e-01},\n\t\t{4.1615e-01, 4.1615e-01, 2.5476e-01, 6.0878e-01, 6.0878e-01, 4.7530e-01, 6.2016e-01, 6.2016e-01, 4.1726e-01, 4.3175e-01},\n\t\t{7.1772e-01, 7.1772e-01, 5.1408e-01, 5.1408e-01},\n\t\t{8.5788e-01, 1.8909e-01, 1.8909e-01, 1.3299e+00, 1.3299e+00, 9.6725e-01},\n\t\t{3.6932e-07, 9.8493e-09, 1.0046e-08, 1.4773e-06},\n\t\t{4.0000e+00, 1.3726e-06, 2.2096e-06},\n\t\t{2.0310e-01, 2.0310e-01, 2.1574e-01, 4.1945e-02, 4.1945e-02, 1.7390e+00},\n\t\t{6.0533e-01, 2.8613e-01, 1.7376e-01, 3.0915e-01, 7.6443e-02, 8.9227e-02},\n\t\t{7.2597e-01, 2.6417e-01, 1.4600e-07, 6.2446e-08, 2.6417e-01, 3.7896e-01},\n\t\t{3.9290e-02, 3.9290e-02, 5.2120e-01, 5.2120e-01, 7.5089e-02, 7.5089e-02},\n\t\t{1.6605e-01, 3.0531e-02, 7.8195e-04, 7.2478e-05, 7.2478e-05, 1.8048e+00},\n\t\t{3.2094e-06, 9.9934e-07, 9.9934e-07, 7.8673e-07, 2.0796e-06, 6.1058e-05, 6.4028e-03, 1.9470e-01, 1.2016e+00, 1.4273e+00, 2.4358e+00, 5.6865e+00},\n\t\t{1.2318e+00, 7.5970e-01, 6.9666e-01, 6.9666e-01, 7.5970e-01, 1.2318e+00},\n\t\t{1.5236e+00, 1.5236e+00, 4.2793e-01, 4.2793e-01, 2.2005e-01, 2.2005e-01},\n\t\t{1.8415e-01, 1.8415e-01, 1.7003e-01, 2.9425e-01, 2.9425e-01, 2.2469e+00},\n\t\t{3.8557e-01, 9.1303e-02, 1.1032e-02, 1.2861e-02, 1.7378e-01, 3.9201e+02},\n\t\t{1.2978e-01, 8.0162e-02, 8.2942e-02, 1.3738e-01, 1.1171e-01, 7.2156e-02, 6.8352e-02, 1.1527e-01},\n\t\t{2.8157e-04, 1.6704e-04, 1.6704e-04, 1.6828e-04, 1.6828e-04, 3.0778e-04},\n\t\t{4.3333e+00, 4.3333e+00, 4.3333e+00, 9.1250e+00},\n\t\t{5.2263e-01, 6.0947e-03, 6.0947e-03, 6.0960e-03, 6.0960e-03},\n\t\t{5.0367e-04, 5.0367e-04, 2.3507e-01, 2.3507e-01, 5.4838e-07, 1.2770e-06},\n\t\t{7.9613e-02, 7.4025e-06, 6.7839e-07, 6.7839e-07, 5.7496e-06, 5.7496e-06, 2.6519e-06, 1.9407e-07, 1.9407e-07, 2.6477e-06},\n\t}\n\n\t// Read input data until N=0. Assume input eigenvalues are sorted\n\t// lexicographically (increasing by real part, then decreasing by\n\t// imaginary part)\n\tfor _i, n = range nlist {\n\t\tcnt++\n\t\tif n == 0 {\n\t\t\treturn\n\t\t}\n\t\tfor i = 1; i <= n; i++ {\n\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\ttmp.Set(i-1, j-1, tmplist[_i][(i-1)*(n)+j-1])\n\t\t\t}\n\t\t}\n\t\tfor i = 1; i <= n; i++ {\n\t\t\twrin.Set(i-1, wrinlist[_i][i-1])\n\t\t\twiin.Set(i-1, wiinlist[_i][i-1])\n\t\t\tsin.Set(i-1, sinlist[_i][i-1])\n\t\t\tsepin.Set(i-1, sepinlist[_i][i-1])\n\t\t}\n\t\ttnrm = golapack.Dlange('M', n, n, tmp, work)\n\n\t\t// Begin test\n\t\tfor iscl = 1; iscl <= 3; iscl++ {\n\t\t\t// Scale input matrix\n\t\t\tknt = knt + 1\n\t\t\tgolapack.Dlacpy(Full, n, n, tmp, t)\n\t\t\tvmul = val.Get(iscl - 1)\n\t\t\tfor i = 1; i <= n; i++ {\n\t\t\t\tt.Off(0, i-1).Vector().Scal(n, vmul, 1)\n\t\t\t}\n\t\t\tif tnrm == zero {\n\t\t\t\tvmul = one\n\t\t\t}\n\n\t\t\t// Compute eigenvalues and eigenvectors\n\t\t\tif err = golapack.Dgehrd(n, 1, n, t, work, work.Off(n), lwork-n); err != nil {\n\t\t\t\t(*lmax)[0] = knt\n\t\t\t\t(*ninfo)[0] = (*ninfo)[0] + 1\n\t\t\t\tgoto label240\n\t\t\t}\n\t\t\tfor j = 1; j <= n-2; j++ {\n\t\t\t\tfor i = j + 2; i <= n; i++ {\n\t\t\t\t\tt.Set(i-1, j-1, zero)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Compute Schur form\n\t\t\tif info, err = golapack.Dhseqr('S', 'N', n, 1, n, t, wr, wi, dum.Matrix(1, opts), work, lwork); info != 0 || err != nil {\n\t\t\t\t(*lmax)[1] = knt\n\t\t\t\t(*ninfo)[1] = (*ninfo)[1] + 1\n\t\t\t\tgoto label240\n\t\t\t}\n\n\t\t\t// Compute eigenvectors\n\t\t\tif _, err = golapack.Dtrevc(Both, 'A', &_select, n, t, le, re, n, work); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\t// Compute condition numbers\n\t\t\tif _, err = golapack.Dtrsna('B', 'A', _select, n, t, le, re, s, sep, n, work.Matrix(n, opts), &iwork); err != nil {\n\t\t\t\t(*lmax)[2] = knt\n\t\t\t\t(*ninfo)[2] = (*ninfo)[2] + 1\n\t\t\t\tgoto label240\n\t\t\t}\n\n\t\t\t// Sort eigenvalues and condition numbers lexicographically\n\t\t\t// to compare with inputs\n\t\t\twrtmp.Copy(n, wr, 1, 1)\n\t\t\twitmp.Copy(n, wi, 1, 1)\n\t\t\tstmp.Copy(n, s, 1, 1)\n\t\t\tseptmp.Copy(n, sep, 1, 1)\n\t\t\tseptmp.Scal(n, one/vmul, 1)\n\t\t\tfor i = 1; i <= n-1; i++ {\n\t\t\t\tkmin = i\n\t\t\t\tvrmin = wrtmp.Get(i - 1)\n\t\t\t\tvimin = witmp.Get(i - 1)\n\t\t\t\tfor j = i + 1; j <= n; j++ {\n\t\t\t\t\tif wrtmp.Get(j-1) < vrmin {\n\t\t\t\t\t\tkmin = j\n\t\t\t\t\t\tvrmin = wrtmp.Get(j - 1)\n\t\t\t\t\t\tvimin = witmp.Get(j - 1)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\twrtmp.Set(kmin-1, wrtmp.Get(i-1))\n\t\t\t\twitmp.Set(kmin-1, witmp.Get(i-1))\n\t\t\t\twrtmp.Set(i-1, vrmin)\n\t\t\t\twitmp.Set(i-1, vimin)\n\t\t\t\tvrmin = stmp.Get(kmin - 1)\n\t\t\t\tstmp.Set(kmin-1, stmp.Get(i-1))\n\t\t\t\tstmp.Set(i-1, vrmin)\n\t\t\t\tvrmin = septmp.Get(kmin - 1)\n\t\t\t\tseptmp.Set(kmin-1, septmp.Get(i-1))\n\t\t\t\tseptmp.Set(i-1, vrmin)\n\t\t\t}\n\n\t\t\t// Compare condition numbers for eigenvalues\n\t\t\t// taking their condition numbers into account\n\t\t\tv = math.Max(two*float64(n)*eps*tnrm, smlnum)\n\t\t\tif tnrm == zero {\n\t\t\t\tv = one\n\t\t\t}\n\t\t\tfor i = 1; i <= n; i++ {\n\t\t\t\tif v > septmp.Get(i-1) {\n\t\t\t\t\ttol = one\n\t\t\t\t} else {\n\t\t\t\t\ttol = v / septmp.Get(i-1)\n\t\t\t\t}\n\t\t\t\tif v > sepin.Get(i-1) {\n\t\t\t\t\ttolin = one\n\t\t\t\t} else {\n\t\t\t\t\ttolin = v / sepin.Get(i-1)\n\t\t\t\t}\n\t\t\t\ttol = math.Max(tol, smlnum/eps)\n\t\t\t\ttolin = math.Max(tolin, smlnum/eps)\n\t\t\t\tif eps*(sin.Get(i-1)-tolin) > stmp.Get(i-1)+tol {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t} else if sin.Get(i-1)-tolin > stmp.Get(i-1)+tol {\n\t\t\t\t\tvmax = (sin.Get(i-1) - tolin) / (stmp.Get(i-1) + tol)\n\t\t\t\t} else if sin.Get(i-1)+tolin < eps*(stmp.Get(i-1)-tol) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t} else if sin.Get(i-1)+tolin < stmp.Get(i-1)-tol {\n\t\t\t\t\tvmax = (stmp.Get(i-1) - tol) / (sin.Get(i-1) + tolin)\n\t\t\t\t} else {\n\t\t\t\t\tvmax = one\n\t\t\t\t}\n\t\t\t\tif vmax > rmax.Get(1) {\n\t\t\t\t\trmax.Set(1, vmax)\n\t\t\t\t\tif (*ninfo)[1] == 0 {\n\t\t\t\t\t\t(*lmax)[1] = knt\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Compare condition numbers for eigenvectors\n\t\t\t// taking their condition numbers into account\n\t\t\tfor i = 1; i <= n; i++ {\n\t\t\t\tif v > septmp.Get(i-1)*stmp.Get(i-1) {\n\t\t\t\t\ttol = septmp.Get(i - 1)\n\t\t\t\t} else {\n\t\t\t\t\ttol = v / stmp.Get(i-1)\n\t\t\t\t}\n\t\t\t\tif v > sepin.Get(i-1)*sin.Get(i-1) {\n\t\t\t\t\ttolin = sepin.Get(i - 1)\n\t\t\t\t} else {\n\t\t\t\t\ttolin = v / sin.Get(i-1)\n\t\t\t\t}\n\t\t\t\ttol = math.Max(tol, smlnum/eps)\n\t\t\t\ttolin = math.Max(tolin, smlnum/eps)\n\t\t\t\tif eps*(sepin.Get(i-1)-tolin) > septmp.Get(i-1)+tol {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t} else if sepin.Get(i-1)-tolin > septmp.Get(i-1)+tol {\n\t\t\t\t\tvmax = (sepin.Get(i-1) - tolin) / (septmp.Get(i-1) + tol)\n\t\t\t\t} else if sepin.Get(i-1)+tolin < eps*(septmp.Get(i-1)-tol) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t} else if sepin.Get(i-1)+tolin < septmp.Get(i-1)-tol {\n\t\t\t\t\tvmax = (septmp.Get(i-1) - tol) / (sepin.Get(i-1) + tolin)\n\t\t\t\t} else {\n\t\t\t\t\tvmax = one\n\t\t\t\t}\n\t\t\t\tif vmax > rmax.Get(1) {\n\t\t\t\t\trmax.Set(1, vmax)\n\t\t\t\t\tif (*ninfo)[1] == 0 {\n\t\t\t\t\t\t(*lmax)[1] = knt\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Compare condition numbers for eigenvalues\n\t\t\t// without taking their condition numbers into account\n\t\t\tfor i = 1; i <= n; i++ {\n\t\t\t\tif sin.Get(i-1) <= float64(2*n)*eps && stmp.Get(i-1) <= float64(2*n)*eps {\n\t\t\t\t\tvmax = one\n\t\t\t\t} else if eps*sin.Get(i-1) > stmp.Get(i-1) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t} else if sin.Get(i-1) > stmp.Get(i-1) {\n\t\t\t\t\tvmax = sin.Get(i-1) / stmp.Get(i-1)\n\t\t\t\t} else if sin.Get(i-1) < eps*stmp.Get(i-1) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t} else if sin.Get(i-1) < stmp.Get(i-1) {\n\t\t\t\t\tvmax = stmp.Get(i-1) / sin.Get(i-1)\n\t\t\t\t} else {\n\t\t\t\t\tvmax = one\n\t\t\t\t}\n\t\t\t\tif vmax > rmax.Get(2) {\n\t\t\t\t\trmax.Set(2, vmax)\n\t\t\t\t\tif (*ninfo)[2] == 0 {\n\t\t\t\t\t\t(*lmax)[2] = knt\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Compare condition numbers for eigenvectors\n\t\t\t// without taking their condition numbers into account\n\t\t\tfor i = 1; i <= n; i++ {\n\t\t\t\tif sepin.Get(i-1) <= v && septmp.Get(i-1) <= v {\n\t\t\t\t\tvmax = one\n\t\t\t\t} else if eps*sepin.Get(i-1) > septmp.Get(i-1) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t} else if sepin.Get(i-1) > septmp.Get(i-1) {\n\t\t\t\t\tvmax = sepin.Get(i-1) / septmp.Get(i-1)\n\t\t\t\t} else if sepin.Get(i-1) < eps*septmp.Get(i-1) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t} else if sepin.Get(i-1) < septmp.Get(i-1) {\n\t\t\t\t\tvmax = septmp.Get(i-1) / sepin.Get(i-1)\n\t\t\t\t} else {\n\t\t\t\t\tvmax = one\n\t\t\t\t}\n\t\t\t\tif vmax > rmax.Get(2) {\n\t\t\t\t\trmax.Set(2, vmax)\n\t\t\t\t\tif (*ninfo)[2] == 0 {\n\t\t\t\t\t\t(*lmax)[2] = knt\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Compute eigenvalue condition numbers only and compare\n\t\t\tvmax = zero\n\t\t\tdum.Set(0, -one)\n\t\t\tstmp.Copy(n, dum, 0, 1)\n\t\t\tseptmp.Copy(n, dum, 0, 1)\n\t\t\tif _, err = golapack.Dtrsna('E', 'A', _select, n, t, le, re, stmp, septmp, n, work.Matrix(n, opts), &iwork); err != nil {\n\t\t\t\t(*lmax)[2] = knt\n\t\t\t\t(*ninfo)[2] = (*ninfo)[2] + 1\n\t\t\t\tgoto label240\n\t\t\t}\n\t\t\tfor i = 1; i <= n; i++ {\n\t\t\t\tif stmp.Get(i-1) != s.Get(i-1) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t\tif septmp.Get(i-1) != dum.Get(0) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Compute eigenvector condition numbers only and compare\n\t\t\tstmp.Copy(n, dum, 0, 1)\n\t\t\tseptmp.Copy(n, dum, 0, 1)\n\t\t\tif _, err = golapack.Dtrsna('V', 'A', _select, n, t, le, re, stmp, septmp, n, work.Matrix(n, opts), &iwork); err != nil {\n\t\t\t\t(*lmax)[2] = knt\n\t\t\t\t(*ninfo)[2] = (*ninfo)[2] + 1\n\t\t\t\tgoto label240\n\t\t\t}\n\t\t\tfor i = 1; i <= n; i++ {\n\t\t\t\tif stmp.Get(i-1) != dum.Get(0) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t\tif septmp.Get(i-1) != sep.Get(i-1) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Compute all condition numbers using SELECT and compare\n\t\t\tfor i = 1; i <= n; i++ {\n\t\t\t\t_select[i-1] = true\n\t\t\t}\n\t\t\tstmp.Copy(n, dum, 0, 1)\n\t\t\tseptmp.Copy(n, dum, 0, 1)\n\t\t\tif _, err = golapack.Dtrsna('B', 'S', _select, n, t, le, re, stmp, septmp, n, work.Matrix(n, opts), &iwork); err != nil {\n\t\t\t\t(*lmax)[2] = knt\n\t\t\t\t(*ninfo)[2] = (*ninfo)[2] + 1\n\t\t\t\tgoto label240\n\t\t\t}\n\t\t\tfor i = 1; i <= n; i++ {\n\t\t\t\tif septmp.Get(i-1) != sep.Get(i-1) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t\tif stmp.Get(i-1) != s.Get(i-1) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Compute eigenvalue condition numbers using SELECT and compare\n\t\t\tstmp.Copy(n, dum, 0, 1)\n\t\t\tseptmp.Copy(n, dum, 0, 1)\n\t\t\tif _, err = golapack.Dtrsna('E', 'S', _select, n, t, le, re, stmp, septmp, n, work.Matrix(n, opts), &iwork); err != nil {\n\t\t\t\t(*lmax)[2] = knt\n\t\t\t\t(*ninfo)[2] = (*ninfo)[2] + 1\n\t\t\t\tgoto label240\n\t\t\t}\n\t\t\tfor i = 1; i <= n; i++ {\n\t\t\t\tif stmp.Get(i-1) != s.Get(i-1) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t\tif septmp.Get(i-1) != dum.Get(0) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Compute eigenvector condition numbers using SELECT and compare\n\t\t\tstmp.Copy(n, dum, 0, 1)\n\t\t\tseptmp.Copy(n, dum, 0, 1)\n\t\t\tif _, err = golapack.Dtrsna('V', 'S', _select, n, t, le, re, stmp, septmp, n, work.Matrix(n, opts), &iwork); err != nil {\n\t\t\t\t(*lmax)[2] = knt\n\t\t\t\t(*ninfo)[2] = (*ninfo)[2] + 1\n\t\t\t\tgoto label240\n\t\t\t}\n\t\t\tfor i = 1; i <= n; i++ {\n\t\t\t\tif stmp.Get(i-1) != dum.Get(0) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t\tif septmp.Get(i-1) != sep.Get(i-1) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t}\n\t\t\tif vmax > rmax.Get(0) {\n\t\t\t\trmax.Set(0, vmax)\n\t\t\t\tif (*ninfo)[0] == 0 {\n\t\t\t\t\t(*lmax)[0] = knt\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Select first real and first complex eigenvalue\n\t\t\tif wi.Get(0) == zero {\n\t\t\t\tlcmp[0] = 1\n\t\t\t\tifnd = 0\n\t\t\t\tfor i = 2; i <= n; i++ {\n\t\t\t\t\tif ifnd == 1 || wi.Get(i-1) == zero {\n\t\t\t\t\t\t_select[i-1] = false\n\t\t\t\t\t} else {\n\t\t\t\t\t\tifnd = 1\n\t\t\t\t\t\tlcmp[1] = i\n\t\t\t\t\t\tlcmp[2] = i + 1\n\t\t\t\t\t\tre.Off(0, 1).Vector().Copy(n, re.Off(0, i-1).Vector(), 1, 1)\n\t\t\t\t\t\tre.Off(0, 2).Vector().Copy(n, re.Off(0, i).Vector(), 1, 1)\n\t\t\t\t\t\tle.Off(0, 1).Vector().Copy(n, le.Off(0, i-1).Vector(), 1, 1)\n\t\t\t\t\t\tle.Off(0, 2).Vector().Copy(n, le.Off(0, i).Vector(), 1, 1)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ifnd == 0 {\n\t\t\t\t\ticmp = 1\n\t\t\t\t} else {\n\t\t\t\t\ticmp = 3\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlcmp[0] = 1\n\t\t\t\tlcmp[1] = 2\n\t\t\t\tifnd = 0\n\t\t\t\tfor i = 3; i <= n; i++ {\n\t\t\t\t\tif ifnd == 1 || wi.Get(i-1) != zero {\n\t\t\t\t\t\t_select[i-1] = false\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlcmp[2] = i\n\t\t\t\t\t\tifnd = 1\n\t\t\t\t\t\tre.Off(0, 2).Vector().Copy(n, re.Off(0, i-1).Vector(), 1, 1)\n\t\t\t\t\t\tle.Off(0, 2).Vector().Copy(n, le.Off(0, i-1).Vector(), 1, 1)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ifnd == 0 {\n\t\t\t\t\ticmp = 2\n\t\t\t\t} else {\n\t\t\t\t\ticmp = 3\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Compute all selected condition numbers\n\t\t\tstmp.Copy(icmp, dum, 0, 1)\n\t\t\tseptmp.Copy(icmp, dum, 0, 1)\n\t\t\tif _, err = golapack.Dtrsna('B', 'S', _select, n, t, le, re, stmp, septmp, n, work.Matrix(n, opts), &iwork); err != nil {\n\t\t\t\t(*lmax)[2] = knt\n\t\t\t\t(*ninfo)[2] = (*ninfo)[2] + 1\n\t\t\t\tgoto label240\n\t\t\t}\n\t\t\tfor i = 1; i <= icmp; i++ {\n\t\t\t\tj = lcmp[i-1]\n\t\t\t\tif septmp.Get(i-1) != sep.Get(j-1) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t\tif stmp.Get(i-1) != s.Get(j-1) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Compute selected eigenvalue condition numbers\n\t\t\tstmp.Copy(icmp, dum, 0, 1)\n\t\t\tseptmp.Copy(icmp, dum, 0, 1)\n\t\t\tif _, err = golapack.Dtrsna('E', 'S', _select, n, t, le, re, stmp, septmp, n, work.Matrix(n, opts), &iwork); err != nil {\n\t\t\t\t(*lmax)[2] = knt\n\t\t\t\t(*ninfo)[2] = (*ninfo)[2] + 1\n\t\t\t\tgoto label240\n\t\t\t}\n\t\t\tfor i = 1; i <= icmp; i++ {\n\t\t\t\tj = lcmp[i-1]\n\t\t\t\tif stmp.Get(i-1) != s.Get(j-1) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t\tif septmp.Get(i-1) != dum.Get(0) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Compute selected eigenvector condition numbers\n\t\t\tstmp.Copy(icmp, dum, 0, 1)\n\t\t\tseptmp.Copy(icmp, dum, 0, 1)\n\t\t\tif _, err = golapack.Dtrsna('V', 'S', _select, n, t, le, re, stmp, septmp, n, work.Matrix(n, opts), &iwork); err != nil {\n\t\t\t\t(*lmax)[2] = knt\n\t\t\t\t(*ninfo)[2] = (*ninfo)[2] + 1\n\t\t\t\tgoto label240\n\t\t\t}\n\t\t\tfor i = 1; i <= icmp; i++ {\n\t\t\t\tj = lcmp[i-1]\n\t\t\t\tif stmp.Get(i-1) != dum.Get(0) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t\tif septmp.Get(i-1) != sep.Get(j-1) {\n\t\t\t\t\tvmax = one / eps\n\t\t\t\t}\n\t\t\t}\n\t\t\tif vmax > rmax.Get(0) {\n\t\t\t\trmax.Set(0, vmax)\n\t\t\t\tif (*ninfo)[0] == 0 {\n\t\t\t\t\t(*lmax)[0] = knt\n\t\t\t\t}\n\t\t\t}\n\t\tlabel240:\n\t\t}\n\t}\n\n\treturn\n}",
"func Dtrtrs(uplo mat.MatUplo, trans mat.MatTrans, diag mat.MatDiag, n, nrhs int, a, b *mat.Matrix) (info int, err error) {\n\tvar nounit bool\n\tvar one, zero float64\n\n\tzero = 0.0\n\tone = 1.0\n\n\t// Test the input parameters.\n\tnounit = diag == NonUnit\n\tif uplo != Upper && uplo != Lower {\n\t\terr = fmt.Errorf(\"uplo != Upper && uplo != Lower: uplo=%s\", uplo)\n\t} else if trans != NoTrans && trans != Trans && trans != ConjTrans {\n\t\terr = fmt.Errorf(\"trans != NoTrans && trans != Trans && trans != ConjTrans: trans=%s\", trans)\n\t} else if !nounit && diag != Unit {\n\t\terr = fmt.Errorf(\"!nounit && diag != Unit: diag=%s\", diag)\n\t} else if n < 0 {\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if nrhs < 0 {\n\t\terr = fmt.Errorf(\"nrhs < 0: nrhs=%v\", nrhs)\n\t} else if a.Rows < max(1, n) {\n\t\terr = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=%v, n=%v\", a.Rows, n)\n\t} else if b.Rows < max(1, n) {\n\t\terr = fmt.Errorf(\"b.Rows < max(1, n): b.Rows=%v, n=%v\", b.Rows, n)\n\t}\n\tif err != nil {\n\t\tgltest.Xerbla2(\"Dtrtrs\", err)\n\t\treturn\n\t}\n\n\t// Quick return if possible\n\tif n == 0 {\n\t\treturn\n\t}\n\n\t// Check for singularity.\n\tif nounit {\n\t\tfor info = 1; info <= n; info++ {\n\t\t\tif a.Get(info-1, info-1) == zero {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tinfo = 0\n\n\t// Solve A * x = b or A**T * x = b.\n\tif err = b.Trsm(Left, uplo, trans, diag, n, nrhs, one, a); err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn\n}",
"func ESS(m int, samples []bmc.Sample, dist Distribution) float64 {\n\tsampleList := make([][][]float64, m)\n\tfor _, s := range samples {\n\t\tsampleList[s.ID] = append(sampleList[s.ID], s.X)\n\t}\n\tn := len(samples) / m\n\tcumAutocorr := ad.NewScalar(ad.RealType, 0)\n\tautocorr := ad.NewScalar(ad.RealType, 0)\n\tt := 0\n\tfor autocorr.GetValue() >= 0 {\n\t\t// Variogram\n\t\tsum := ad.NewScalar(ad.RealType, 0)\n\t\tfor j := 0; j != m; j++ {\n\t\t\tfor i := t; i != n; i++ {\n\t\t\t\tij, imtj := bmc.Float64ToVector(sampleList[j][i]), bmc.Float64ToVector(sampleList[j][i-t])\n\t\t\t\tdistance := ads.Sub(dist(ij), dist(imtj))\n\t\t\t\tdistSquare := ads.Mul(distance, distance)\n\t\t\t\tsum = ads.Add(sum, distSquare)\n\t\t\t}\n\t\t}\n\t\tVt := ads.Div(sum, ad.NewReal(float64(m*(n-t-1))))\n\t\t// Within-sequence variance\n\t\tsum = ad.NewScalar(ad.RealType, 0)\n\t\tfor j := 0; j != m; j++ {\n\t\t\tmeanj := ad.NewScalar(ad.RealType, 0)\n\t\t\tfor i := 0; i != n; i++ {\n\t\t\t\tij := dist(bmc.Float64ToVector(sampleList[j][i]))\n\t\t\t\tmeanj = ads.Add(meanj, ij)\n\t\t\t}\n\t\t\tmeanj = ads.Div(meanj, ad.NewReal(float64(n)))\n\t\t\tfor i := 0; i != n; i++ {\n\t\t\t\tij := dist(bmc.Float64ToVector(sampleList[j][i]))\n\t\t\t\tdistance := ads.Sub(ij, meanj)\n\t\t\t\tdistSquare := ads.Mul(distance, distance)\n\t\t\t\tsum = ads.Add(sum, distSquare)\n\t\t\t}\n\t\t}\n\t\tW := ads.Div(sum, ad.NewReal(float64(m*(n-1))))\n\t\t// TODO Between-sequence variance\n\t\tmean := ad.NewScalar(ad.RealType, 0)\n\t\tfor j := 0; j != m; j++ {\n\t\t\tmeanj := ad.NewScalar(ad.RealType, 0)\n\t\t\tfor i := 0; i != n; i++ {\n\t\t\t\tij := dist(bmc.Float64ToVector(sampleList[j][i]))\n\t\t\t\tmeanj = ads.Add(meanj, ij)\n\t\t\t}\n\t\t\tmeanj = ads.Div(meanj, ad.NewReal(float64(n)))\n\t\t\tmean = ads.Add(mean, meanj)\n\t\t}\n\t\tmean = ads.Div(mean, ad.NewReal(float64(m)))\n\t\tsum = ad.NewScalar(ad.RealType, 0)\n\t\tfor j := 0; j != m; j++ {\n\t\t\tmeanj := ad.NewScalar(ad.RealType, 0)\n\t\t\tfor i := 0; i != n; i++ {\n\t\t\t\tij := dist(bmc.Float64ToVector(sampleList[j][i]))\n\t\t\t\tmeanj = ads.Add(meanj, ij)\n\t\t\t}\n\t\t\tmeanj = ads.Div(meanj, ad.NewReal(float64(n)))\n\t\t\tdistance := ads.Sub(meanj, mean)\n\t\t\tdistSquare := ads.Mul(distance, distance)\n\t\t\tsum = ads.Add(sum, distSquare)\n\t\t}\n\t\tB := ads.Mul(ad.NewReal(float64(n/(m-1))), sum)\n\t\tvarPlus := ads.Add(ads.Mul(ad.NewReal(float64((n-1)/n)), W), ads.Div(B, ad.NewReal(float64(n))))\n\t\tautocorr = ads.Sub(ad.NewReal(1), ads.Div(ads.Div(Vt, varPlus), ad.NewReal(2)))\n\t\tcumAutocorr = ads.Add(cumAutocorr, autocorr)\n\t\tt++\n\t}\n\treturn float64(m*n) / (1. + 2*cumAutocorr.GetValue())\n}",
"func zchkec(thresh float64, tsterr bool, t *testing.T) (ntests int) {\n\t// var ok bool\n\tvar eps, rtrexc, rtrsyl, sfmin float64\n\t_ = eps\n\t_ = sfmin\n\tvar ktrexc, ktrsen, ktrsna, ktrsyl, ltrexc, ltrsyl, ntrexc, ntrsyl int\n\trtrsen := vf(3)\n\trtrsna := vf(3)\n\tltrsen := make([]int, 3)\n\tltrsna := make([]int, 3)\n\tntrsen := make([]int, 3)\n\tntrsna := make([]int, 3)\n\n\t// path := \"Zec\"\n\teps = golapack.Dlamch(Precision)\n\tsfmin = golapack.Dlamch(SafeMinimum)\n\t// fmt.Printf(\" Tests of the Nonsymmetric eigenproblem condition estimation routines\\n Ztrsyl, Ztrexc, Ztrsna, Ztrsen\\n\\n\")\n\t// fmt.Printf(\" Relative machine precision (eps) = %16.6E\\n Safe minimum (sfmin) = %16.6E\\n\\n\", eps, sfmin)\n\t// fmt.Printf(\" Routines pass computational tests if test ratio is less than%8.2f\\n\\n\\n\", thresh)\n\n\t// Test error exits if TSTERR is .TRUE.\n\t// if tsterr {\n\t// \tzerrec(path, t)\n\t// }\n\n\t// ok = true\n\trtrsyl, ltrsyl, ntrsyl, ktrsyl = zget35()\n\tif rtrsyl > thresh {\n\t\tt.Fail()\n\t\t// ok = false\n\t\tfmt.Printf(\" Error in Ztrsyl: RMAX =%12.3E\\n LMAX = %8d NINFO=%8d KNT=%8d\\n\", rtrsyl, ltrsyl, ntrsyl, ktrsyl)\n\t}\n\n\trtrexc, ltrexc, ntrexc, ktrexc = zget36()\n\tif rtrexc > thresh || ntrexc > 0 {\n\t\tt.Fail()\n\t\t// ok = false\n\t\tfmt.Printf(\" Error in Ztrexc: RMAX =%12.3E\\n LMAX = %8d NINFO=%8d KNT=%8d\\n\", rtrexc, ltrexc, ntrexc, ktrexc)\n\t}\n\n\tktrsna = zget37(rtrsna, <rsna, &ntrsna)\n\tif rtrsna.Get(0) > thresh || rtrsna.Get(1) > thresh || ntrsna[0] != 0 || ntrsna[1] != 0 || ntrsna[2] != 0 {\n\t\tt.Fail()\n\t\t// ok = false\n\t\tfmt.Printf(\" Error in Ztrsna: RMAX =%v\\n LMAX = %8d NINFO=%8d KNT=%8d\\n\", rtrsna, ltrsna, ntrsna, ktrsna)\n\t}\n\n\tktrsen = zget38(rtrsen, <rsen, &ntrsen)\n\tif rtrsen.Get(0) > thresh || rtrsen.Get(1) > thresh || ntrsen[0] != 0 || ntrsen[1] != 0 || ntrsen[2] != 0 {\n\t\tt.Fail()\n\t\t// ok = false\n\t\tfmt.Printf(\" Error in Ztrsen: RMAX =%v\\n LMAX = %8d NINFO=%8d KNT=%8d\\n\", rtrsen, ltrsen, ntrsen, ktrsen)\n\t}\n\n\tntests = ktrsyl + ktrexc + ktrsna + ktrsen\n\t// if ok {\n\t// \tfmt.Printf(\"\\n All tests for %3s routines passed the threshold ( %6d tests run)\\n\", path, ntests)\n\t// }\n\n\treturn\n}",
"func ECDH_ECPSP_DSA(sha int, RNG *core.RAND, S []byte, F []byte, C []byte, D []byte) int {\n\tvar T [EFS]byte\n\n\tB := core.GPhashit(core.MC_SHA2, sha, int(MODBYTES), 0, F, -1, nil )\n\tG := ECP_generator()\n\n\tr := NewBIGints(CURVE_Order)\n\n\ts := FromBytes(S)\n\tf := FromBytes(B[:])\n\n\tc := NewBIGint(0)\n\td := NewBIGint(0)\n\tV := NewECP()\n\n\tfor d.iszilch() {\n\t\tu := Randomnum(r, RNG)\n\t\tw := Randomnum(r, RNG) /* side channel masking */\n\t\tV.Copy(G)\n\t\tV = V.mul(u)\n\t\tvx := V.GetX()\n\t\tc.copy(vx)\n\t\tc.Mod(r)\n\t\tif c.iszilch() {\n\t\t\tcontinue\n\t\t}\n\t\tu.copy(Modmul(u, w, r))\n\t\tu.Invmodp(r)\n\t\td.copy(Modmul(s, c, r))\n\t\td.add(f)\n\t\td.copy(Modmul(d, w, r))\n\t\td.copy(Modmul(u, d, r))\n\t}\n\n\tc.ToBytes(T[:])\n\tfor i := 0; i < EFS; i++ {\n\t\tC[i] = T[i]\n\t}\n\td.ToBytes(T[:])\n\tfor i := 0; i < EFS; i++ {\n\t\tD[i] = T[i]\n\t}\n\treturn 0\n}",
"func Dfst(n int, a []float64, t []float64, ip []int, w []float64) {\n\tvar j, k, l, m, mh, nw, nc int\n\tvar xr, xi, yr, yi float64\n\n\tnw = ip[0]\n\tif n > (nw << 3) {\n\t\tnw = n >> 3\n\t\tmakewt(nw, ip, w)\n\t}\n\tnc = ip[1]\n\tif n > (nc << 1) {\n\t\tnc = n >> 1\n\t\tmakect(nc, ip, w[nw:])\n\t}\n\tif n > 2 {\n\t\tm = n >> 1\n\t\tmh = m >> 1\n\t\tfor j = 1; j < mh; j++ {\n\t\t\tk = m - j\n\t\t\txr = a[j] + a[n-j]\n\t\t\txi = a[j] - a[n-j]\n\t\t\tyr = a[k] + a[n-k]\n\t\t\tyi = a[k] - a[n-k]\n\t\t\ta[j] = xr\n\t\t\ta[k] = yr\n\t\t\tt[j] = xi + yi\n\t\t\tt[k] = xi - yi\n\t\t}\n\t\tt[0] = a[mh] - a[n-mh]\n\t\ta[mh] += a[n-mh]\n\t\ta[0] = a[m]\n\t\tdstsub(m, a, nc, w[nw:])\n\t\tif m > 4 {\n\t\t\tcftfsub(m, a, ip, nw, w)\n\t\t\trftfsub(m, a, nc, w[nw:])\n\t\t} else if m == 4 {\n\t\t\tcftfsub(m, a, ip, nw, w)\n\t\t}\n\t\ta[n-1] = a[1] - a[0]\n\t\ta[1] = a[0] + a[1]\n\t\tfor j = m - 2; j >= 2; j -= 2 {\n\t\t\ta[2*j+1] = a[j] - a[j+1]\n\t\t\ta[2*j-1] = -a[j] - a[j+1]\n\t\t}\n\t\tl = 2\n\t\tm = mh\n\t\tfor m >= 2 {\n\t\t\tdstsub(m, t, nc, w[nw:])\n\t\t\tif m > 4 {\n\t\t\t\tcftfsub(m, t, ip, nw, w)\n\t\t\t\trftfsub(m, t, nc, w[nw:])\n\t\t\t} else if m == 4 {\n\t\t\t\tcftfsub(m, t, ip, nw, w)\n\t\t\t}\n\t\t\ta[n-l] = t[1] - t[0]\n\t\t\ta[l] = t[0] + t[1]\n\t\t\tk = 0\n\t\t\tfor j = 2; j < m; j += 2 {\n\t\t\t\tk += l << 2\n\t\t\t\ta[k-l] = -t[j] - t[j+1]\n\t\t\t\ta[k+l] = t[j] - t[j+1]\n\t\t\t}\n\t\t\tl <<= 1\n\t\t\tmh = m >> 1\n\t\t\tfor j = 1; j < mh; j++ {\n\t\t\t\tk = m - j\n\t\t\t\tt[j] = t[m+k] + t[m+j]\n\t\t\t\tt[k] = t[m+k] - t[m+j]\n\t\t\t}\n\t\t\tt[0] = t[m+mh]\n\t\t\tm = mh\n\t\t}\n\t\ta[l] = t[0]\n\t}\n\ta[0] = 0\n}",
"func ECDH_ECPVP_DSA(sha int, W []byte, F []byte, C []byte, D []byte) int {\n\tres := 0\n\n\tB := core.GPhashit(core.MC_SHA2, sha, int(MODBYTES), 0, F, -1, nil )\n\n\tG := ECP_generator()\n\tr := NewBIGints(CURVE_Order)\n\n\tc := FromBytes(C)\n\td := FromBytes(D)\n\tf := FromBytes(B[:])\n\n\tif c.iszilch() || Comp(c, r) >= 0 || d.iszilch() || Comp(d, r) >= 0 {\n\t\tres = ERROR\n\t}\n\n\tif res == 0 {\n\t\td.Invmodp(r)\n\t\tf.copy(Modmul(f, d, r))\n\t\th2 := Modmul(c, d, r)\n\n\t\tWP := ECP_fromBytes(W)\n\t\tif WP.Is_infinity() {\n\t\t\tres = ERROR\n\t\t} else {\n\t\t\tP := NewECP()\n\t\t\tP.Copy(WP)\n\n\t\t\tP = P.Mul2(h2, G, f)\n\n\t\t\tif P.Is_infinity() {\n\t\t\t\tres = ERROR\n\t\t\t} else {\n\t\t\t\td = P.GetX()\n\t\t\t\td.Mod(r)\n\n\t\t\t\tif Comp(d, c) != 0 {\n\t\t\t\t\tres = ERROR\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn res\n}",
"func ECDH_ECIES_DECRYPT(sha int, P1 []byte, P2 []byte, V []byte, C []byte, T []byte, U []byte) []byte {\n\tvar Z [EFS]byte\n\tvar VZ [3*EFS + 1]byte\n\tvar K1 [AESKEY]byte\n\tvar K2 [AESKEY]byte\n\n\tvar TAG []byte = T[:]\n\n\tif ECDH_ECPSVDP_DH(U, V, Z[:], 0) != 0 {\n\t\treturn nil\n\t}\n\n\tfor i := 0; i < 2*EFS+1; i++ {\n\t\tVZ[i] = V[i]\n\t}\n\tfor i := 0; i < EFS; i++ {\n\t\tVZ[2*EFS+1+i] = Z[i]\n\t}\n\n\tK := core.KDF2(core.MC_SHA2, sha, VZ[:], P1, 2*AESKEY)\n\n\tfor i := 0; i < AESKEY; i++ {\n\t\tK1[i] = K[i]\n\t\tK2[i] = K[AESKEY+i]\n\t}\n\n\tM := core.AES_CBC_IV0_DECRYPT(K1[:], C)\n\n\tif M == nil {\n\t\treturn nil\n\t}\n\n\tL2 := core.InttoBytes(len(P2), 8)\n\n\tvar AC []byte\n\n\tfor i := 0; i < len(C); i++ {\n\t\tAC = append(AC, C[i])\n\t}\n\tfor i := 0; i < len(P2); i++ {\n\t\tAC = append(AC, P2[i])\n\t}\n\tfor i := 0; i < 8; i++ {\n\t\tAC = append(AC, L2[i])\n\t}\n\n\tcore.HMAC(core.MC_SHA2, sha, TAG, len(TAG), K2[:],AC)\n\n\tif !ncomp(T, TAG, len(T)) {\n\t\treturn nil\n\t}\n\n\treturn M\n}",
"func Dsbgvd(jobz byte, uplo mat.MatUplo, n, ka, kb int, ab, bb *mat.Matrix, w *mat.Vector, z *mat.Matrix, work *mat.Vector, lwork int, iwork *[]int, liwork int) (info int, err error) {\n\tvar lquery, upper, wantz bool\n\tvar vect byte\n\tvar one, zero float64\n\tvar inde, indwk2, indwrk, liwmin, llwrk2, lwmin int\n\n\tone = 1.0\n\tzero = 0.0\n\n\t// Test the input parameters.\n\twantz = jobz == 'V'\n\tupper = uplo == Upper\n\tlquery = (lwork == -1 || liwork == -1)\n\n\tif n <= 1 {\n\t\tliwmin = 1\n\t\tlwmin = 1\n\t} else if wantz {\n\t\tliwmin = 3 + 5*n\n\t\tlwmin = 1 + 5*n + 2*pow(n, 2)\n\t} else {\n\t\tliwmin = 1\n\t\tlwmin = 2 * n\n\t}\n\n\tif !(wantz || jobz == 'N') {\n\t\terr = fmt.Errorf(\"!(wantz || jobz == 'N'): jobz='%c'\", jobz)\n\t} else if !(upper || uplo == Lower) {\n\t\terr = fmt.Errorf(\"!(upper || uplo == Lower): uplo=%s\", uplo)\n\t} else if n < 0 {\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if ka < 0 {\n\t\terr = fmt.Errorf(\"ka < 0: ka=%v\", ka)\n\t} else if kb < 0 || kb > ka {\n\t\terr = fmt.Errorf(\"kb < 0 || kb > ka: kb=%v, ka=%v\", kb, ka)\n\t} else if ab.Rows < ka+1 {\n\t\terr = fmt.Errorf(\"ab.Rows < ka+1: ab.Rows=%v, ka=%v\", ab.Rows, ka)\n\t} else if bb.Rows < kb+1 {\n\t\terr = fmt.Errorf(\"bb.Rows < kb+1: bb.Rows=%v, kb=%v\", bb.Rows, kb)\n\t} else if z.Rows < 1 || (wantz && z.Rows < n) {\n\t\terr = fmt.Errorf(\"z.Rows < 1 || (wantz && z.Rows < n): jobz='%c', z.Rows=%v, n=%v\", jobz, z.Rows, n)\n\t}\n\n\tif err == nil {\n\t\twork.Set(0, float64(lwmin))\n\t\t(*iwork)[0] = liwmin\n\n\t\tif lwork < lwmin && !lquery {\n\t\t\terr = fmt.Errorf(\"lwork < lwmin && !lquery: lwork=%v, lwmin=%v, lquery=%v\", lwork, lwmin, lquery)\n\t\t} else if liwork < liwmin && !lquery {\n\t\t\terr = fmt.Errorf(\"liwork < liwmin && !lquery: liwork=%v, liwmin=%v, lquery=%v\", liwork, liwmin, lquery)\n\t\t}\n\t}\n\n\tif err != nil {\n\t\tgltest.Xerbla2(\"Dsbgvd\", err)\n\t\treturn\n\t} else if lquery {\n\t\treturn\n\t}\n\n\t// Quick return if possible\n\tif n == 0 {\n\t\treturn\n\t}\n\n\t// Form a split Cholesky factorization of B.\n\tif info, err = Dpbstf(uplo, n, kb, bb); err != nil {\n\t\tpanic(err)\n\t}\n\tif info != 0 {\n\t\tinfo = n + info\n\t\treturn\n\t}\n\n\t// Transform problem to standard eigenvalue problem.\n\tinde = 1\n\tindwrk = inde + n\n\tindwk2 = indwrk + n*n\n\tllwrk2 = lwork - indwk2 + 1\n\tif err = Dsbgst(jobz, uplo, n, ka, kb, ab, bb, z, work); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Reduce to tridiagonal form.\n\tif wantz {\n\t\tvect = 'U'\n\t} else {\n\t\tvect = 'N'\n\t}\n\tif err = Dsbtrd(vect, uplo, n, ka, ab, w, work.Off(inde-1), z, work.Off(indwrk-1)); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// For eigenvalues only, call DSTERF. For eigenvectors, call SSTEDC.\n\tif !wantz {\n\t\tif info, err = Dsterf(n, w, work.Off(inde-1)); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t} else {\n\t\tif info, err = Dstedc('I', n, w, work.Off(inde-1), work.Off(indwrk-1).Matrix(n, opts), work.Off(indwk2-1), llwrk2, iwork, liwork); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif err = work.Off(indwk2-1).Matrix(n, opts).Gemm(NoTrans, NoTrans, n, n, n, one, z, work.Off(indwrk-1).Matrix(n, opts), zero); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tDlacpy(Full, n, n, work.Off(indwk2-1).Matrix(n, opts), z)\n\t}\n\n\twork.Set(0, float64(lwmin))\n\t(*iwork)[0] = liwmin\n\n\treturn\n}",
"func DsytriRook(uplo mat.MatUplo, n int, a *mat.Matrix, ipiv *[]int, work *mat.Vector) (info int, err error) {\n\tvar upper bool\n\tvar ak, akkp1, akp1, d, one, t, temp, zero float64\n\tvar k, kp, kstep int\n\n\tone = 1.0\n\tzero = 0.0\n\n\t// Test the input parameters.\n\tupper = uplo == Upper\n\tif !upper && uplo != Lower {\n\t\terr = fmt.Errorf(\"!upper && uplo != Lower: uplo=%s\", uplo)\n\t} else if n < 0 {\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if a.Rows < max(1, n) {\n\t\terr = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=%v, n=%v\", a.Rows, n)\n\t}\n\tif err != nil {\n\t\tgltest.Xerbla2(\"DsytriRook\", err)\n\t\treturn\n\t}\n\n\t// Quick return if possible\n\tif n == 0 {\n\t\treturn\n\t}\n\n\t// Check that the diagonal matrix D is nonsingular.\n\tif upper {\n\t\t// Upper triangular storage: examine D from bottom to top\n\t\tfor info = n; info >= 1; info-- {\n\t\t\tif (*ipiv)[info-1] > 0 && a.Get(info-1, info-1) == zero {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Lower triangular storage: examine D from top to bottom.\n\t\tfor info = 1; info <= n; info++ {\n\t\t\tif (*ipiv)[info-1] > 0 && a.Get(info-1, info-1) == zero {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tinfo = 0\n\n\tif upper {\n\t\t// Compute inv(A) from the factorization A = U*D*U**T.\n\t\t//\n\t\t// K is the main loop index, increasing from 1 to N in steps of\n\t\t// 1 or 2, depending on the size of the diagonal blocks.\n\t\tk = 1\n\tlabel30:\n\t\t;\n\n\t\t// If K > N, exit from loop.\n\t\tif k > n {\n\t\t\tgoto label40\n\t\t}\n\n\t\tif (*ipiv)[k-1] > 0 {\n\t\t\t// 1 x 1 diagonal block\n\t\t\t//\n\t\t\t// Invert the diagonal block.\n\t\t\ta.Set(k-1, k-1, one/a.Get(k-1, k-1))\n\n\t\t\t// Compute column K of the inverse.\n\t\t\tif k > 1 {\n\t\t\t\twork.Copy(k-1, a.Off(0, k-1).Vector(), 1, 1)\n\t\t\t\terr = a.Off(0, k-1).Vector().Symv(uplo, k-1, -one, a, work, 1, zero, 1)\n\t\t\t\ta.Set(k-1, k-1, a.Get(k-1, k-1)-a.Off(0, k-1).Vector().Dot(k-1, work, 1, 1))\n\t\t\t}\n\t\t\tkstep = 1\n\t\t} else {\n\t\t\t// 2 x 2 diagonal block\n\t\t\t//\n\t\t\t// Invert the diagonal block.\n\t\t\tt = math.Abs(a.Get(k-1, k))\n\t\t\tak = a.Get(k-1, k-1) / t\n\t\t\takp1 = a.Get(k, k) / t\n\t\t\takkp1 = a.Get(k-1, k) / t\n\t\t\td = t * (ak*akp1 - one)\n\t\t\ta.Set(k-1, k-1, akp1/d)\n\t\t\ta.Set(k, k, ak/d)\n\t\t\ta.Set(k-1, k, -akkp1/d)\n\n\t\t\t// Compute columns K and K+1 of the inverse.\n\t\t\tif k > 1 {\n\t\t\t\twork.Copy(k-1, a.Off(0, k-1).Vector(), 1, 1)\n\t\t\t\terr = a.Off(0, k-1).Vector().Symv(uplo, k-1, -one, a, work, 1, zero, 1)\n\t\t\t\ta.Set(k-1, k-1, a.Get(k-1, k-1)-a.Off(0, k-1).Vector().Dot(k-1, work, 1, 1))\n\t\t\t\ta.Set(k-1, k, a.Get(k-1, k)-a.Off(0, k).Vector().Dot(k-1, a.Off(0, k-1).Vector(), 1, 1))\n\t\t\t\twork.Copy(k-1, a.Off(0, k).Vector(), 1, 1)\n\t\t\t\terr = a.Off(0, k).Vector().Symv(uplo, k-1, -one, a, work, 1, zero, 1)\n\t\t\t\ta.Set(k, k, a.Get(k, k)-a.Off(0, k).Vector().Dot(k-1, work, 1, 1))\n\t\t\t}\n\t\t\tkstep = 2\n\t\t}\n\n\t\tif kstep == 1 {\n\t\t\t// Interchange rows and columns K and IPIV(K) in the leading\n\t\t\t// submatrix A(1:k+1,1:k+1)\n\t\t\tkp = (*ipiv)[k-1]\n\t\t\tif kp != k {\n\t\t\t\tif kp > 1 {\n\t\t\t\t\ta.Off(0, kp-1).Vector().Swap(kp-1, a.Off(0, k-1).Vector(), 1, 1)\n\t\t\t\t}\n\t\t\t\ta.Off(kp-1, kp).Vector().Swap(k-kp-1, a.Off(kp, k-1).Vector(), 1, a.Rows)\n\t\t\t\ttemp = a.Get(k-1, k-1)\n\t\t\t\ta.Set(k-1, k-1, a.Get(kp-1, kp-1))\n\t\t\t\ta.Set(kp-1, kp-1, temp)\n\t\t\t}\n\t\t} else {\n\t\t\t// Interchange rows and columns K and K+1 with -IPIV(K) and\n\t\t\t// -IPIV(K+1)in the leading submatrix A(1:k+1,1:k+1)\n\t\t\tkp = -(*ipiv)[k-1]\n\t\t\tif kp != k {\n\t\t\t\tif kp > 1 {\n\t\t\t\t\ta.Off(0, kp-1).Vector().Swap(kp-1, a.Off(0, k-1).Vector(), 1, 1)\n\t\t\t\t}\n\t\t\t\ta.Off(kp-1, kp).Vector().Swap(k-kp-1, a.Off(kp, k-1).Vector(), 1, a.Rows)\n\t\t\t\t//\n\t\t\t\ttemp = a.Get(k-1, k-1)\n\t\t\t\ta.Set(k-1, k-1, a.Get(kp-1, kp-1))\n\t\t\t\ta.Set(kp-1, kp-1, temp)\n\t\t\t\ttemp = a.Get(k-1, k)\n\t\t\t\ta.Set(k-1, k, a.Get(kp-1, k))\n\t\t\t\ta.Set(kp-1, k, temp)\n\t\t\t}\n\n\t\t\tk = k + 1\n\t\t\tkp = -(*ipiv)[k-1]\n\t\t\tif kp != k {\n\t\t\t\tif kp > 1 {\n\t\t\t\t\ta.Off(0, kp-1).Vector().Swap(kp-1, a.Off(0, k-1).Vector(), 1, 1)\n\t\t\t\t}\n\t\t\t\ta.Off(kp-1, kp).Vector().Swap(k-kp-1, a.Off(kp, k-1).Vector(), 1, a.Rows)\n\t\t\t\ttemp = a.Get(k-1, k-1)\n\t\t\t\ta.Set(k-1, k-1, a.Get(kp-1, kp-1))\n\t\t\t\ta.Set(kp-1, kp-1, temp)\n\t\t\t}\n\t\t}\n\n\t\tk = k + 1\n\t\tgoto label30\n\tlabel40:\n\t} else {\n\t\t// Compute inv(A) from the factorization A = L*D*L**T.\n\t\t//\n\t\t// K is the main loop index, increasing from 1 to N in steps of\n\t\t// 1 or 2, depending on the size of the diagonal blocks.\n\t\tk = n\n\tlabel50:\n\t\t;\n\n\t\t// If K < 1, exit from loop.\n\t\tif k < 1 {\n\t\t\tgoto label60\n\t\t}\n\n\t\tif (*ipiv)[k-1] > 0 {\n\t\t\t// 1 x 1 diagonal block\n\t\t\t//\n\t\t\t// Invert the diagonal block.\n\t\t\ta.Set(k-1, k-1, one/a.Get(k-1, k-1))\n\n\t\t\t// Compute column K of the inverse.\n\t\t\tif k < n {\n\t\t\t\twork.Copy(n-k, a.Off(k, k-1).Vector(), 1, 1)\n\t\t\t\terr = a.Off(k, k-1).Vector().Symv(uplo, n-k, -one, a.Off(k, k), work, 1, zero, 1)\n\t\t\t\ta.Set(k-1, k-1, a.Get(k-1, k-1)-a.Off(k, k-1).Vector().Dot(n-k, work, 1, 1))\n\t\t\t}\n\t\t\tkstep = 1\n\t\t} else {\n\t\t\t// 2 x 2 diagonal block\n\t\t\t//\n\t\t\t// Invert the diagonal block.\n\t\t\tt = math.Abs(a.Get(k-1, k-1-1))\n\t\t\tak = a.Get(k-1-1, k-1-1) / t\n\t\t\takp1 = a.Get(k-1, k-1) / t\n\t\t\takkp1 = a.Get(k-1, k-1-1) / t\n\t\t\td = t * (ak*akp1 - one)\n\t\t\ta.Set(k-1-1, k-1-1, akp1/d)\n\t\t\ta.Set(k-1, k-1, ak/d)\n\t\t\ta.Set(k-1, k-1-1, -akkp1/d)\n\n\t\t\t// Compute columns K-1 and K of the inverse.\n\t\t\tif k < n {\n\t\t\t\twork.Copy(n-k, a.Off(k, k-1).Vector(), 1, 1)\n\t\t\t\terr = a.Off(k, k-1).Vector().Symv(uplo, n-k, -one, a.Off(k, k), work, 1, zero, 1)\n\t\t\t\ta.Set(k-1, k-1, a.Get(k-1, k-1)-a.Off(k, k-1).Vector().Dot(n-k, work, 1, 1))\n\t\t\t\ta.Set(k-1, k-1-1, a.Get(k-1, k-1-1)-a.Off(k, k-1-1).Vector().Dot(n-k, a.Off(k, k-1).Vector(), 1, 1))\n\t\t\t\twork.Copy(n-k, a.Off(k, k-1-1).Vector(), 1, 1)\n\t\t\t\terr = a.Off(k, k-1-1).Vector().Symv(uplo, n-k, -one, a.Off(k, k), work, 1, zero, 1)\n\t\t\t\ta.Set(k-1-1, k-1-1, a.Get(k-1-1, k-1-1)-a.Off(k, k-1-1).Vector().Dot(n-k, work, 1, 1))\n\t\t\t}\n\t\t\tkstep = 2\n\t\t}\n\n\t\tif kstep == 1 {\n\t\t\t// Interchange rows and columns K and IPIV(K) in the trailing\n\t\t\t// submatrix A(k-1:n,k-1:n)\n\t\t\tkp = (*ipiv)[k-1]\n\t\t\tif kp != k {\n\t\t\t\tif kp < n {\n\t\t\t\t\ta.Off(kp, kp-1).Vector().Swap(n-kp, a.Off(kp, k-1).Vector(), 1, 1)\n\t\t\t\t}\n\t\t\t\ta.Off(kp-1, k).Vector().Swap(kp-k-1, a.Off(k, k-1).Vector(), 1, a.Rows)\n\t\t\t\ttemp = a.Get(k-1, k-1)\n\t\t\t\ta.Set(k-1, k-1, a.Get(kp-1, kp-1))\n\t\t\t\ta.Set(kp-1, kp-1, temp)\n\t\t\t}\n\t\t} else {\n\t\t\t// Interchange rows and columns K and K-1 with -IPIV(K) and\n\t\t\t// -IPIV(K-1) in the trailing submatrix A(k-1:n,k-1:n)\n\t\t\tkp = -(*ipiv)[k-1]\n\t\t\tif kp != k {\n\t\t\t\tif kp < n {\n\t\t\t\t\ta.Off(kp, kp-1).Vector().Swap(n-kp, a.Off(kp, k-1).Vector(), 1, 1)\n\t\t\t\t}\n\t\t\t\ta.Off(kp-1, k).Vector().Swap(kp-k-1, a.Off(k, k-1).Vector(), 1, a.Rows)\n\n\t\t\t\ttemp = a.Get(k-1, k-1)\n\t\t\t\ta.Set(k-1, k-1, a.Get(kp-1, kp-1))\n\t\t\t\ta.Set(kp-1, kp-1, temp)\n\t\t\t\ttemp = a.Get(k-1, k-1-1)\n\t\t\t\ta.Set(k-1, k-1-1, a.Get(kp-1, k-1-1))\n\t\t\t\ta.Set(kp-1, k-1-1, temp)\n\t\t\t}\n\n\t\t\tk = k - 1\n\t\t\tkp = -(*ipiv)[k-1]\n\t\t\tif kp != k {\n\t\t\t\tif kp < n {\n\t\t\t\t\ta.Off(kp, kp-1).Vector().Swap(n-kp, a.Off(kp, k-1).Vector(), 1, 1)\n\t\t\t\t}\n\t\t\t\ta.Off(kp-1, k).Vector().Swap(kp-k-1, a.Off(k, k-1).Vector(), 1, a.Rows)\n\t\t\t\ttemp = a.Get(k-1, k-1)\n\t\t\t\ta.Set(k-1, k-1, a.Get(kp-1, kp-1))\n\t\t\t\ta.Set(kp-1, kp-1, temp)\n\t\t\t}\n\t\t}\n\n\t\tk = k - 1\n\t\tgoto label50\n\tlabel60:\n\t}\n\n\treturn\n}",
"func Dlatmt(m, n int, dist byte, iseed *[]int, sym byte, d *mat.Vector, mode int, cond, dmax float64, rank, kl, ku int, pack byte, a *mat.Matrix, work *mat.Vector) (info int, err error) {\n\tvar givens, ilextr, iltemp, topdwn bool\n\tvar alpha, angle, c, dummy, extra, one, s, temp, twopi, zero float64\n\tvar i, ic, icol, idist, iendch, il, ilda, ioffg, ioffst, ipack, ipackg, ir, ir1, ir2, irow, irsign, iskew, isym, isympk, j, jc, jch, jkl, jku, jr, k, llb, minlda, mnmin, mr, nc, uub int\n\n\tzero = 0.0\n\tone = 1.0\n\ttwopi = 2 * math.Pi\n\n\t// Quick return if possible\n\tif m == 0 || n == 0 {\n\t\treturn\n\t}\n\n\t// Decode DIST\n\tif dist == 'U' {\n\t\tidist = 1\n\t} else if dist == 'S' {\n\t\tidist = 2\n\t} else if dist == 'N' {\n\t\tidist = 3\n\t} else {\n\t\tidist = -1\n\t}\n\n\t// Decode SYM\n\tif sym == 'N' {\n\t\tisym = 1\n\t\tirsign = 0\n\t} else if sym == 'P' {\n\t\tisym = 2\n\t\tirsign = 0\n\t} else if sym == 'S' {\n\t\tisym = 2\n\t\tirsign = 1\n\t} else if sym == 'H' {\n\t\tisym = 2\n\t\tirsign = 1\n\t} else {\n\t\tisym = -1\n\t}\n\n\t// Decode PACK\n\tisympk = 0\n\tif pack == 'N' {\n\t\tipack = 0\n\t} else if pack == 'U' {\n\t\tipack = 1\n\t\tisympk = 1\n\t} else if pack == 'L' {\n\t\tipack = 2\n\t\tisympk = 1\n\t} else if pack == 'C' {\n\t\tipack = 3\n\t\tisympk = 2\n\t} else if pack == 'R' {\n\t\tipack = 4\n\t\tisympk = 3\n\t} else if pack == 'B' {\n\t\tipack = 5\n\t\tisympk = 3\n\t} else if pack == 'Q' {\n\t\tipack = 6\n\t\tisympk = 2\n\t} else if pack == 'Z' {\n\t\tipack = 7\n\t} else {\n\t\tipack = -1\n\t}\n\n\t// Set certain internal parameters\n\tmnmin = min(m, n)\n\tllb = min(kl, m-1)\n\tuub = min(ku, n-1)\n\tmr = min(m, n+llb)\n\tnc = min(n, m+uub)\n\n\tif ipack == 5 || ipack == 6 {\n\t\tminlda = uub + 1\n\t} else if ipack == 7 {\n\t\tminlda = llb + uub + 1\n\t} else {\n\t\tminlda = m\n\t}\n\n\t// Use Givens rotation method if bandwidth small enough,\n\t// or if LDA is too small to store the matrix unpacked.\n\tgivens = false\n\tif isym == 1 {\n\t\tif float64(llb+uub) < 0.3*float64(max(1, mr+nc)) {\n\t\t\tgivens = true\n\t\t}\n\t} else {\n\t\tif 2*llb < m {\n\t\t\tgivens = true\n\t\t}\n\t}\n\tif a.Rows < m && a.Rows >= minlda {\n\t\tgivens = true\n\t}\n\n\t// Set INFO if an error\n\tif m < 0 {\n\t\tinfo = -1\n\t\terr = fmt.Errorf(\"m < 0: m=%v\", m)\n\t} else if m != n && isym != 1 {\n\t\tinfo = -1\n\t\terr = fmt.Errorf(\"m != n && isym != 1: m=%v, sym='%c'\", m, sym)\n\t} else if n < 0 {\n\t\tinfo = -2\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if idist == -1 {\n\t\tinfo = -3\n\t\terr = fmt.Errorf(\"idist == -1: dist='%c'\", dist)\n\t} else if isym == -1 {\n\t\tinfo = -5\n\t\terr = fmt.Errorf(\"isym == -1: sym='%c'\", sym)\n\t} else if abs(mode) > 6 {\n\t\tinfo = -7\n\t\terr = fmt.Errorf(\"abs(mode) > 6: mode=%v\", mode)\n\t} else if (mode != 0 && abs(mode) != 6) && cond < one {\n\t\tinfo = -8\n\t\terr = fmt.Errorf(\"(mode != 0 && abs(mode) != 6) && cond < one: mode=%v, cond=%v\", mode, cond)\n\t} else if kl < 0 {\n\t\tinfo = -10\n\t\terr = fmt.Errorf(\"kl < 0: kl=%v\", kl)\n\t} else if ku < 0 || (isym != 1 && kl != ku) {\n\t\tinfo = -11\n\t\terr = fmt.Errorf(\"ku < 0 || (isym != 1 && kl != ku): sym='%c', kl=%v, ku=%v\", sym, kl, ku)\n\t} else if ipack == -1 || (isympk == 1 && isym == 1) || (isympk == 2 && isym == 1 && kl > 0) || (isympk == 3 && isym == 1 && ku > 0) || (isympk != 0 && m != n) {\n\t\tinfo = -12\n\t\terr = fmt.Errorf(\"ipack == -1 || (isympk == 1 && isym == 1) || (isympk == 2 && isym == 1 && kl > 0) || (isympk == 3 && isym == 1 && ku > 0) || (isympk != 0 && m != n): pack='%c', isympk=%v, sym='%c', m=%v, n=%v, kl=%v, ku=%v\", pack, isympk, sym, m, n, kl, ku)\n\t} else if a.Rows < max(1, minlda) {\n\t\tinfo = -14\n\t\terr = fmt.Errorf(\"a.Rows < max(1, minlda): a.Rows=%v, minlda=%v\", a.Rows, minlda)\n\t}\n\n\tif info != 0 {\n\t\tgltest.Xerbla(\"Dlatmt\", -info)\n\t\treturn\n\t}\n\n\t// Initialize random number generator\n\tfor i = 1; i <= 4; i++ {\n\t\t(*iseed)[i-1] = abs((*iseed)[i-1]) % 4096\n\t}\n\n\tif (*iseed)[3]%2 != 1 {\n\t\t(*iseed)[3] = (*iseed)[3] + 1\n\t}\n\n\t// 2) Set up D if indicated.\n\t//\n\t// Compute D according to COND and MODE\n\tif err = Dlatm7(mode, cond, irsign, idist, iseed, d, mnmin, rank); err != nil {\n\t\tinfo = 1\n\t\treturn\n\t}\n\n\t// Choose Top-Down if D is (apparently) increasing,\n\t// Bottom-Up if D is (apparently) decreasing.\n\tif math.Abs(d.Get(0)) <= math.Abs(d.Get(rank-1)) {\n\t\ttopdwn = true\n\t} else {\n\t\ttopdwn = false\n\t}\n\n\tif mode != 0 && abs(mode) != 6 {\n\t\t// Scale by DMAX\n\t\ttemp = math.Abs(d.Get(0))\n\t\tfor i = 2; i <= rank; i++ {\n\t\t\ttemp = math.Max(temp, math.Abs(d.Get(i-1)))\n\t\t}\n\n\t\tif temp > zero {\n\t\t\talpha = dmax / temp\n\t\t} else {\n\t\t\tinfo = 2\n\t\t\treturn\n\t\t}\n\n\t\td.Scal(rank, alpha, 1)\n\t}\n\n\t// 3) Generate Banded Matrix using Givens rotations.\n\t// Also the special case of UUB=LLB=0\n\t//\n\t// Compute Addressing constants to cover all\n\t// storage formats. Whether GE, SY, GB, or SB,\n\t// upper or lower triangle or both,\n\t// the (i,j)-th element is in\n\t// A( i - ISKEW*j + IOFFST, j )\n\tif ipack > 4 {\n\t\tilda = a.Rows - 1\n\t\tiskew = 1\n\t\tif ipack > 5 {\n\t\t\tioffst = uub + 1\n\t\t} else {\n\t\t\tioffst = 1\n\t\t}\n\t} else {\n\t\tilda = a.Rows\n\t\tiskew = 0\n\t\tioffst = 0\n\t}\n\n\t// IPACKG is the format that the matrix is generated in. If this is\n\t// different from IPACK, then the matrix must be repacked at the\n\t// end. It also signals how to compute the norm, for scaling.\n\tipackg = 0\n\tgolapack.Dlaset(Full, a.Rows, n, zero, zero, a)\n\n\t// Diagonal Matrix -- We are done, unless it\n\t// is to be stored SP/PP/TP (PACK='R' or 'C')\n\tif llb == 0 && uub == 0 {\n\t\ta.Off(1-iskew+ioffst-1, 0).Vector().Copy(mnmin, d, 1, ilda+1)\n\t\tif ipack <= 2 || ipack >= 5 {\n\t\t\tipackg = ipack\n\t\t}\n\n\t} else if givens {\n\t\t// Check whether to use Givens rotations,\n\t\t// Householder transformations, or nothing.\n\t\tif isym == 1 {\n\t\t\t// Non-symmetric -- A = U D V\n\t\t\tif ipack > 4 {\n\t\t\t\tipackg = ipack\n\t\t\t} else {\n\t\t\t\tipackg = 0\n\t\t\t}\n\n\t\t\ta.Off(1-iskew+ioffst-1, 0).Vector().Copy(mnmin, d, 1, ilda+1)\n\n\t\t\tif topdwn {\n\t\t\t\tjkl = 0\n\t\t\t\tfor jku = 1; jku <= uub; jku++ {\n\t\t\t\t\t// Transform from bandwidth JKL, JKU-1 to JKL, JKU\n\t\t\t\t\t//\n\t\t\t\t\t// Last row actually rotated is M\n\t\t\t\t\t// Last column actually rotated is MIN( M+JKU, N )\n\t\t\t\t\tfor jr = 1; jr <= min(m+jku, n)+jkl-1; jr++ {\n\t\t\t\t\t\textra = zero\n\t\t\t\t\t\tangle = twopi * Dlarnd(1, iseed)\n\t\t\t\t\t\tc = math.Cos(angle)\n\t\t\t\t\t\ts = math.Sin(angle)\n\t\t\t\t\t\ticol = max(1, jr-jkl)\n\t\t\t\t\t\tif jr < m {\n\t\t\t\t\t\t\til = min(n, jr+jku) + 1 - icol\n\t\t\t\t\t\t\textra, dummy = Dlarot(true, jr > jkl, false, il, c, s, a.Off(jr-iskew*icol+ioffst-1, icol-1).Vector(), ilda, extra, dummy)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Chase \"EXTRA\" back up\n\t\t\t\t\t\tir = jr\n\t\t\t\t\t\tic = icol\n\t\t\t\t\t\tfor jch = jr - jkl; jch >= 1; jch -= (jkl + jku) {\n\t\t\t\t\t\t\tif ir < m {\n\t\t\t\t\t\t\t\tc, s, dummy = golapack.Dlartg(a.Get(ir+1-iskew*(ic+1)+ioffst-1, ic), extra)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tirow = max(1, jch-jku)\n\t\t\t\t\t\t\til = ir + 2 - irow\n\t\t\t\t\t\t\ttemp = zero\n\t\t\t\t\t\t\tiltemp = jch > jku\n\t\t\t\t\t\t\ttemp, extra = Dlarot(false, iltemp, true, il, c, -s, a.Off(irow-iskew*ic+ioffst-1, ic-1).Vector(), ilda, temp, extra)\n\t\t\t\t\t\t\tif iltemp {\n\t\t\t\t\t\t\t\tc, s, dummy = golapack.Dlartg(a.Get(irow+1-iskew*(ic+1)+ioffst-1, ic), temp)\n\t\t\t\t\t\t\t\ticol = max(1, jch-jku-jkl)\n\t\t\t\t\t\t\t\til = ic + 2 - icol\n\t\t\t\t\t\t\t\textra = zero\n\t\t\t\t\t\t\t\textra, temp = Dlarot(true, jch > jku+jkl, true, il, c, -s, a.Off(irow-iskew*icol+ioffst-1, icol-1).Vector(), ilda, extra, temp)\n\t\t\t\t\t\t\t\tic = icol\n\t\t\t\t\t\t\t\tir = irow\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tjku = uub\n\t\t\t\tfor jkl = 1; jkl <= llb; jkl++ {\n\t\t\t\t\t// Transform from bandwidth JKL-1, JKU to JKL, JKU\n\t\t\t\t\tfor jc = 1; jc <= min(n+jkl, m)+jku-1; jc++ {\n\t\t\t\t\t\textra = zero\n\t\t\t\t\t\tangle = twopi * Dlarnd(1, iseed)\n\t\t\t\t\t\tc = math.Cos(angle)\n\t\t\t\t\t\ts = math.Sin(angle)\n\t\t\t\t\t\tirow = max(1, jc-jku)\n\t\t\t\t\t\tif jc < n {\n\t\t\t\t\t\t\til = min(m, jc+jkl) + 1 - irow\n\t\t\t\t\t\t\textra, dummy = Dlarot(false, jc > jku, false, il, c, s, a.Off(irow-iskew*jc+ioffst-1, jc-1).Vector(), ilda, extra, dummy)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Chase \"EXTRA\" back up\n\t\t\t\t\t\tic = jc\n\t\t\t\t\t\tir = irow\n\t\t\t\t\t\tfor jch = jc - jku; jch >= 1; jch -= (jkl + jku) {\n\t\t\t\t\t\t\tif ic < n {\n\t\t\t\t\t\t\t\tc, s, dummy = golapack.Dlartg(a.Get(ir+1-iskew*(ic+1)+ioffst-1, ic), extra)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticol = max(1, jch-jkl)\n\t\t\t\t\t\t\til = ic + 2 - icol\n\t\t\t\t\t\t\ttemp = zero\n\t\t\t\t\t\t\tiltemp = jch > jkl\n\t\t\t\t\t\t\ttemp, extra = Dlarot(true, iltemp, true, il, c, -s, a.Off(ir-iskew*icol+ioffst-1, icol-1).Vector(), ilda, temp, extra)\n\t\t\t\t\t\t\tif iltemp {\n\t\t\t\t\t\t\t\tc, s, dummy = golapack.Dlartg(a.Get(ir+1-iskew*(icol+1)+ioffst-1, icol), temp)\n\t\t\t\t\t\t\t\tirow = max(1, jch-jkl-jku)\n\t\t\t\t\t\t\t\til = ir + 2 - irow\n\t\t\t\t\t\t\t\textra = zero\n\t\t\t\t\t\t\t\textra, temp = Dlarot(false, jch > jkl+jku, true, il, c, -s, a.Off(irow-iskew*icol+ioffst-1, icol-1).Vector(), ilda, extra, temp)\n\t\t\t\t\t\t\t\tic = icol\n\t\t\t\t\t\t\t\tir = irow\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t// Bottom-Up -- Start at the bottom right.\n\t\t\t\tjkl = 0\n\t\t\t\tfor jku = 1; jku <= uub; jku++ {\n\t\t\t\t\t// Transform from bandwidth JKL, JKU-1 to JKL, JKU\n\t\t\t\t\t//\n\t\t\t\t\t// First row actually rotated is M\n\t\t\t\t\t// First column actually rotated is MIN( M+JKU, N )\n\t\t\t\t\tiendch = min(m, n+jkl) - 1\n\t\t\t\t\tfor jc = min(m+jku, n) - 1; jc >= 1-jkl; jc-- {\n\t\t\t\t\t\textra = zero\n\t\t\t\t\t\tangle = twopi * Dlarnd(1, iseed)\n\t\t\t\t\t\tc = math.Cos(angle)\n\t\t\t\t\t\ts = math.Sin(angle)\n\t\t\t\t\t\tirow = max(1, jc-jku+1)\n\t\t\t\t\t\tif jc > 0 {\n\t\t\t\t\t\t\til = min(m, jc+jkl+1) + 1 - irow\n\t\t\t\t\t\t\tdummy, extra = Dlarot(false, false, jc+jkl < m, il, c, s, a.Off(irow-iskew*jc+ioffst-1, jc-1).Vector(), ilda, dummy, extra)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Chase \"EXTRA\" back down\n\t\t\t\t\t\tic = jc\n\t\t\t\t\t\tfor _, jch = range genIter(jc+jkl, iendch, jkl+jku) {\n\t\t\t\t\t\t\tilextr = ic > 0\n\t\t\t\t\t\t\tif ilextr {\n\t\t\t\t\t\t\t\tc, s, dummy = golapack.Dlartg(a.Get(jch-iskew*ic+ioffst-1, ic-1), extra)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tic = max(1, ic)\n\t\t\t\t\t\t\ticol = min(n-1, jch+jku)\n\t\t\t\t\t\t\tiltemp = jch+jku < n\n\t\t\t\t\t\t\ttemp = zero\n\t\t\t\t\t\t\textra, temp = Dlarot(true, ilextr, iltemp, icol+2-ic, c, s, a.Off(jch-iskew*ic+ioffst-1, ic-1).Vector(), ilda, extra, temp)\n\t\t\t\t\t\t\tif iltemp {\n\t\t\t\t\t\t\t\tc, s, dummy = golapack.Dlartg(a.Get(jch-iskew*icol+ioffst-1, icol-1), temp)\n\t\t\t\t\t\t\t\til = min(iendch, jch+jkl+jku) + 2 - jch\n\t\t\t\t\t\t\t\textra = zero\n\t\t\t\t\t\t\t\ttemp, extra = Dlarot(false, true, jch+jkl+jku <= iendch, il, c, s, a.Off(jch-iskew*icol+ioffst-1, icol-1).Vector(), ilda, temp, extra)\n\t\t\t\t\t\t\t\tic = icol\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tjku = uub\n\t\t\t\tfor jkl = 1; jkl <= llb; jkl++ {\n\t\t\t\t\t// Transform from bandwidth JKL-1, JKU to JKL, JKU\n\t\t\t\t\t//\n\t\t\t\t\t// First row actually rotated is MIN( N+JKL, M )\n\t\t\t\t\t// First column actually rotated is N\n\t\t\t\t\tiendch = min(n, m+jku) - 1\n\t\t\t\t\tfor jr = min(n+jkl, m) - 1; jr >= 1-jku; jr-- {\n\t\t\t\t\t\textra = zero\n\t\t\t\t\t\tangle = twopi * Dlarnd(1, iseed)\n\t\t\t\t\t\tc = math.Cos(angle)\n\t\t\t\t\t\ts = math.Sin(angle)\n\t\t\t\t\t\ticol = max(1, jr-jkl+1)\n\t\t\t\t\t\tif jr > 0 {\n\t\t\t\t\t\t\til = min(n, jr+jku+1) + 1 - icol\n\t\t\t\t\t\t\tdummy, extra = Dlarot(true, false, jr+jku < n, il, c, s, a.Off(jr-iskew*icol+ioffst-1, icol-1).Vector(), ilda, dummy, extra)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Chase \"EXTRA\" back down\n\t\t\t\t\t\tir = jr\n\t\t\t\t\t\tfor _, jch = range genIter(jr+jku, iendch, jkl+jku) {\n\t\t\t\t\t\t\tilextr = ir > 0\n\t\t\t\t\t\t\tif ilextr {\n\t\t\t\t\t\t\t\tc, s, dummy = golapack.Dlartg(a.Get(ir-iskew*jch+ioffst-1, jch-1), extra)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tir = max(1, ir)\n\t\t\t\t\t\t\tirow = min(m-1, jch+jkl)\n\t\t\t\t\t\t\tiltemp = jch+jkl < m\n\t\t\t\t\t\t\ttemp = zero\n\t\t\t\t\t\t\textra, temp = Dlarot(false, ilextr, iltemp, irow+2-ir, c, s, a.Off(ir-iskew*jch+ioffst-1, jch-1).Vector(), ilda, extra, temp)\n\t\t\t\t\t\t\tif iltemp {\n\t\t\t\t\t\t\t\tc, s, dummy = golapack.Dlartg(a.Get(irow-iskew*jch+ioffst-1, jch-1), temp)\n\t\t\t\t\t\t\t\til = min(iendch, jch+jkl+jku) + 2 - jch\n\t\t\t\t\t\t\t\textra = zero\n\t\t\t\t\t\t\t\ttemp, extra = Dlarot(true, true, jch+jkl+jku <= iendch, il, c, s, a.Off(irow-iskew*jch+ioffst-1, jch-1).Vector(), ilda, temp, extra)\n\t\t\t\t\t\t\t\tir = irow\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t// Symmetric -- A = U D U'\n\t\t\t// ipackg = ipack\n\t\t\tioffg = ioffst\n\n\t\t\tif topdwn {\n\t\t\t\t// Top-Down -- Generate Upper triangle only\n\t\t\t\tif ipack >= 5 {\n\t\t\t\t\tipackg = 6\n\t\t\t\t\tioffg = uub + 1\n\t\t\t\t} else {\n\t\t\t\t\tipackg = 1\n\t\t\t\t}\n\t\t\t\ta.Off(1-iskew+ioffg-1, 0).Vector().Copy(mnmin, d, 1, ilda+1)\n\n\t\t\t\tfor k = 1; k <= uub; k++ {\n\t\t\t\t\tfor jc = 1; jc <= n-1; jc++ {\n\t\t\t\t\t\tirow = max(1, jc-k)\n\t\t\t\t\t\til = min(jc+1, k+2)\n\t\t\t\t\t\textra = zero\n\t\t\t\t\t\ttemp = a.Get(jc-iskew*(jc+1)+ioffg-1, jc)\n\t\t\t\t\t\tangle = twopi * Dlarnd(1, iseed)\n\t\t\t\t\t\tc = math.Cos(angle)\n\t\t\t\t\t\ts = math.Sin(angle)\n\t\t\t\t\t\textra, temp = Dlarot(false, jc > k, true, il, c, s, a.Off(irow-iskew*jc+ioffg-1, jc-1).Vector(), ilda, extra, temp)\n\t\t\t\t\t\ttemp, dummy = Dlarot(true, true, false, min(k, n-jc)+1, c, s, a.Off((1-iskew)*jc+ioffg-1, jc-1).Vector(), ilda, temp, dummy)\n\n\t\t\t\t\t\t// Chase EXTRA back up the matrix\n\t\t\t\t\t\ticol = jc\n\t\t\t\t\t\tfor jch = jc - k; jch >= 1; jch -= k {\n\t\t\t\t\t\t\tc, s, dummy = golapack.Dlartg(a.Get(jch+1-iskew*(icol+1)+ioffg-1, icol), extra)\n\t\t\t\t\t\t\ttemp = a.Get(jch-iskew*(jch+1)+ioffg-1, jch)\n\t\t\t\t\t\t\ttemp, extra = Dlarot(true, true, true, k+2, c, -s, a.Off((1-iskew)*jch+ioffg-1, jch-1).Vector(), ilda, temp, extra)\n\t\t\t\t\t\t\tirow = max(1, jch-k)\n\t\t\t\t\t\t\til = min(jch+1, k+2)\n\t\t\t\t\t\t\textra = zero\n\t\t\t\t\t\t\textra, temp = Dlarot(false, jch > k, true, il, c, -s, a.Off(irow-iskew*jch+ioffg-1, jch-1).Vector(), ilda, extra, temp)\n\t\t\t\t\t\t\ticol = jch\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If we need lower triangle, copy from upper. Note that\n\t\t\t\t// the order of copying is chosen to work for 'q' -> 'b'\n\t\t\t\tif ipack != ipackg && ipack != 3 {\n\t\t\t\t\tfor jc = 1; jc <= n; jc++ {\n\t\t\t\t\t\tirow = ioffst - iskew*jc\n\t\t\t\t\t\tfor jr = jc; jr <= min(n, jc+uub); jr++ {\n\t\t\t\t\t\t\ta.Set(jr+irow-1, jc-1, a.Get(jc-iskew*jr+ioffg-1, jr-1))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ipack == 5 {\n\t\t\t\t\t\tfor jc = n - uub + 1; jc <= n; jc++ {\n\t\t\t\t\t\t\tfor jr = n + 2 - jc; jr <= uub+1; jr++ {\n\t\t\t\t\t\t\t\ta.Set(jr-1, jc-1, zero)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ipackg == 6 {\n\t\t\t\t\t\tipackg = ipack\n\t\t\t\t\t} else {\n\t\t\t\t\t\tipackg = 0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Bottom-Up -- Generate Lower triangle only\n\t\t\t\tif ipack >= 5 {\n\t\t\t\t\tipackg = 5\n\t\t\t\t\tif ipack == 6 {\n\t\t\t\t\t\tioffg = 1\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tipackg = 2\n\t\t\t\t}\n\t\t\t\ta.Off(1-iskew+ioffg-1, 0).Vector().Copy(mnmin, d, 1, ilda+1)\n\n\t\t\t\tfor k = 1; k <= uub; k++ {\n\t\t\t\t\tfor jc = n - 1; jc >= 1; jc-- {\n\t\t\t\t\t\til = min(n+1-jc, k+2)\n\t\t\t\t\t\textra = zero\n\t\t\t\t\t\ttemp = a.Get(1+(1-iskew)*jc+ioffg-1, jc-1)\n\t\t\t\t\t\tangle = twopi * Dlarnd(1, iseed)\n\t\t\t\t\t\tc = math.Cos(angle)\n\t\t\t\t\t\ts = -math.Sin(angle)\n\t\t\t\t\t\ttemp, extra = Dlarot(false, true, n-jc > k, il, c, s, a.Off((1-iskew)*jc+ioffg-1, jc-1).Vector(), ilda, temp, extra)\n\t\t\t\t\t\ticol = max(1, jc-k+1)\n\t\t\t\t\t\tdummy, temp = Dlarot(true, false, true, jc+2-icol, c, s, a.Off(jc-iskew*icol+ioffg-1, icol-1).Vector(), ilda, dummy, temp)\n\n\t\t\t\t\t\t// Chase EXTRA back down the matrix\n\t\t\t\t\t\ticol = jc\n\t\t\t\t\t\tfor _, jch = range genIter(jc+k, n-1, k) {\n\t\t\t\t\t\t\tc, s, dummy = golapack.Dlartg(a.Get(jch-iskew*icol+ioffg-1, icol-1), extra)\n\t\t\t\t\t\t\ttemp = a.Get(1+(1-iskew)*jch+ioffg-1, jch-1)\n\t\t\t\t\t\t\textra, temp = Dlarot(true, true, true, k+2, c, s, a.Off(jch-iskew*icol+ioffg-1, icol-1).Vector(), ilda, extra, temp)\n\t\t\t\t\t\t\til = min(n+1-jch, k+2)\n\t\t\t\t\t\t\textra = zero\n\t\t\t\t\t\t\ttemp, extra = Dlarot(false, true, n-jch > k, il, c, s, a.Off((1-iskew)*jch+ioffg-1, jch-1).Vector(), ilda, temp, extra)\n\t\t\t\t\t\t\ticol = jch\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If we need upper triangle, copy from lower. Note that\n\t\t\t\t// the order of copying is chosen to work for 'b' -> 'q'\n\t\t\t\tif ipack != ipackg && ipack != 4 {\n\t\t\t\t\tfor jc = n; jc >= 1; jc-- {\n\t\t\t\t\t\tirow = ioffst - iskew*jc\n\t\t\t\t\t\tfor jr = jc; jr >= max(1, jc-uub); jr-- {\n\t\t\t\t\t\t\ta.Set(jr+irow-1, jc-1, a.Get(jc-iskew*jr+ioffg-1, jr-1))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ipack == 6 {\n\t\t\t\t\t\tfor jc = 1; jc <= uub; jc++ {\n\t\t\t\t\t\t\tfor jr = 1; jr <= uub+1-jc; jr++ {\n\t\t\t\t\t\t\t\ta.Set(jr-1, jc-1, zero)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ipackg == 5 {\n\t\t\t\t\t\tipackg = ipack\n\t\t\t\t\t} else {\n\t\t\t\t\t\tipackg = 0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\t// 4) Generate Banded Matrix by first\n\t\t// Rotating by random Unitary matrices,\n\t\t// then reducing the bandwidth using Householder\n\t\t// transformations.\n\t\t//\n\t\t// Note: we should get here only if LDA .ge. N\n\t\tif isym == 1 {\n\t\t\t// Non-symmetric -- A = U D V\n\t\t\terr = Dlagge(mr, nc, llb, uub, d, a, iseed, work)\n\t\t} else {\n\t\t\t// Symmetric -- A = U D U'\n\t\t\terr = Dlagsy(m, llb, d, a, iseed, work)\n\n\t\t}\n\t\tif err != nil {\n\t\t\tinfo = 3\n\t\t\treturn\n\t\t}\n\t}\n\n\t// 5) Pack the matrix\n\tif ipack != ipackg {\n\t\tif ipack == 1 {\n\t\t\t// 'U' -- Upper triangular, not packed\n\t\t\tfor j = 1; j <= m; j++ {\n\t\t\t\tfor i = j + 1; i <= m; i++ {\n\t\t\t\t\ta.Set(i-1, j-1, zero)\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else if ipack == 2 {\n\t\t\t// 'L' -- Lower triangular, not packed\n\t\t\tfor j = 2; j <= m; j++ {\n\t\t\t\tfor i = 1; i <= j-1; i++ {\n\t\t\t\t\ta.Set(i-1, j-1, zero)\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else if ipack == 3 {\n\t\t\t// 'C' -- Upper triangle packed Columnwise.\n\t\t\ticol = 1\n\t\t\tirow = 0\n\t\t\tfor j = 1; j <= m; j++ {\n\t\t\t\tfor i = 1; i <= j; i++ {\n\t\t\t\t\tirow = irow + 1\n\t\t\t\t\tif irow > a.Rows {\n\t\t\t\t\t\tirow = 1\n\t\t\t\t\t\ticol = icol + 1\n\t\t\t\t\t}\n\t\t\t\t\ta.Set(irow-1, icol-1, a.Get(i-1, j-1))\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else if ipack == 4 {\n\t\t\t// 'R' -- Lower triangle packed Columnwise.\n\t\t\ticol = 1\n\t\t\tirow = 0\n\t\t\tfor j = 1; j <= m; j++ {\n\t\t\t\tfor i = j; i <= m; i++ {\n\t\t\t\t\tirow = irow + 1\n\t\t\t\t\tif irow > a.Rows {\n\t\t\t\t\t\tirow = 1\n\t\t\t\t\t\ticol = icol + 1\n\t\t\t\t\t}\n\t\t\t\t\ta.Set(irow-1, icol-1, a.Get(i-1, j-1))\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else if ipack >= 5 {\n\t\t\t// 'B' -- The lower triangle is packed as a band matrix.\n\t\t\t// 'Q' -- The upper triangle is packed as a band matrix.\n\t\t\t// 'Z' -- The whole matrix is packed as a band matrix.\n\t\t\tif ipack == 5 {\n\t\t\t\tuub = 0\n\t\t\t}\n\t\t\tif ipack == 6 {\n\t\t\t\tllb = 0\n\t\t\t}\n\n\t\t\tfor j = 1; j <= uub; j++ {\n\t\t\t\tfor i = min(j+llb, m); i >= 1; i-- {\n\t\t\t\t\ta.Set(i-j+uub, j-1, a.Get(i-1, j-1))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor j = uub + 2; j <= n; j++ {\n\t\t\t\tfor i = j - uub; i <= min(j+llb, m); i++ {\n\t\t\t\t\ta.Set(i-j+uub, j-1, a.Get(i-1, j-1))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If packed, zero out extraneous elements.\n\t\t//\n\t\t// Symmetric/Triangular Packed --\n\t\t// zero out everything after A(IROW,ICOL)\n\t\tif ipack == 3 || ipack == 4 {\n\t\t\tfor jc = icol; jc <= m; jc++ {\n\t\t\t\tfor jr = irow + 1; jr <= a.Rows; jr++ {\n\t\t\t\t\ta.Set(jr-1, jc-1, zero)\n\t\t\t\t}\n\t\t\t\tirow = 0\n\t\t\t}\n\n\t\t} else if ipack >= 5 {\n\t\t\t// Packed Band --\n\t\t\t// 1st row is now in A( UUB+2-j, j), zero above it\n\t\t\t// m-th row is now in A( M+UUB-j,j), zero below it\n\t\t\t// last non-zero diagonal is now in A( UUB+LLB+1,j ),\n\t\t\t// zero below it, too.\n\t\t\tir1 = uub + llb + 2\n\t\t\tir2 = uub + m + 2\n\t\t\tfor jc = 1; jc <= n; jc++ {\n\t\t\t\tfor jr = 1; jr <= uub+1-jc; jr++ {\n\t\t\t\t\ta.Set(jr-1, jc-1, zero)\n\t\t\t\t}\n\t\t\t\tfor jr = max(1, min(ir1, ir2-jc)); jr <= a.Rows; jr++ {\n\t\t\t\t\ta.Set(jr-1, jc-1, zero)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}",
"func Ddct(n int, isgn int, a []float64, ip []int, w []float64) {\n\tvar j, nw, nc int\n\tvar xr float64\n\n\tnw = ip[0]\n\tif n > (nw << 2) {\n\t\tnw = n >> 2\n\t\tmakewt(nw, ip, w)\n\t}\n\tnc = ip[1]\n\tif n > nc {\n\t\tnc = n\n\t\tmakect(nc, ip, w[nw:])\n\t}\n\tif isgn < 0 {\n\t\txr = a[n-1]\n\t\tfor j = n - 2; j >= 2; j -= 2 {\n\t\t\ta[j+1] = a[j] - a[j-1]\n\t\t\ta[j] += a[j-1]\n\t\t}\n\t\ta[1] = a[0] - xr\n\t\ta[0] += xr\n\t\tif n > 4 {\n\t\t\trftbsub(n, a, nc, w[nw:])\n\t\t\tcftbsub(n, a, ip, nw, w)\n\t\t} else if n == 4 {\n\t\t\tcftbsub(n, a, ip, nw, w)\n\t\t}\n\t}\n\tdctsub(n, a, nc, w[nw:])\n\tif isgn >= 0 {\n\t\tif n > 4 {\n\t\t\tcftfsub(n, a, ip, nw, w)\n\t\t\trftfsub(n, a, nc, w[nw:])\n\t\t} else if n == 4 {\n\t\t\tcftfsub(n, a, ip, nw, w)\n\t\t}\n\t\txr = a[0] - a[1]\n\t\ta[0] += a[1]\n\t\tfor j = 2; j < n; j += 2 {\n\t\t\ta[j-1] = a[j] - a[j+1]\n\t\t\ta[j] += a[j+1]\n\t\t}\n\t\ta[n-1] = xr\n\t}\n}",
"func spreadingDesease(networkPointer *bigNet, epochs int, epochsResultsPointer *[simulationEpochs][5]int, muskPointer *muskMeasure, socialDistancePointer *socialDistancingMeasure, ssnPointer *nationalHealthcareSystem, trialsResultsPointer *[][3]int, ssnEpochResults *[simulationEpochs][2]int, trial int) error {\n\tfor epoch := 0; epoch < epochs; epoch++ {\n\n\t\tif epoch == 0 {\n\t\t\t// pick a random infect over the graph\n\t\t\tcase0 := rand.Intn(nNodes)\n\t\t\t(*networkPointer)[case0].Infective = true\n\t\t\tlog.Println(\"CASE 0:\", case0)\n\t\t\tinfectiveDaysLen := len((*networkPointer)[case0].InfectiveDays)\n\n\t\t\tfor day := 0; day < infectiveDaysLen; day++ {\n\t\t\t\tif (*networkPointer)[case0].InfectiveDays[day] == 0 {\n\n\t\t\t\t\tisInfected, infected := middlewareContainmentMeasure(&(*networkPointer)[case0], muskPointer, socialDistancePointer, epoch)\n\n\t\t\t\t\tif isInfected {\n\n\t\t\t\t\t\tif (*networkPointer)[infected].InfectiveEpochs > 0 {\n\t\t\t\t\t\t\t// Check if Healthcare is neeeded\n\t\t\t\t\t\t\trequireHealthcare, typeHealthcare := bernoulliHealthcare(pIntensiveCare, pSubIntensiveCare)\n\t\t\t\t\t\t\tif requireHealthcare {\n\t\t\t\t\t\t\t\t// if Healthcare needed, check if there are bed available\n\t\t\t\t\t\t\t\taddedToSSN := addToSSN(ssnPointer, uint32(infected), typeHealthcare)\n\t\t\t\t\t\t\t\tif addedToSSN {\n\t\t\t\t\t\t\t\t\t// if added to SSN can still infect others\n\t\t\t\t\t\t\t\t\t(*networkPointer)[infected].Infective = true\n\t\t\t\t\t\t\t\t\t(*networkPointer)[infected].InfectiveEpochs += hospitalDays\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// if not possible to add to SSN the patient is dead\n\t\t\t\t\t\t\t\t\t//log.Println(\"NO BED AVAILABLE\")\n\t\t\t\t\t\t\t\t\t(*networkPointer)[infected].InfectiveEpochs = 0\n\t\t\t\t\t\t\t\t\t(*networkPointer)[infected].Dead = true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t(*networkPointer)[infected].Infective = true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// I set to -1 in order to not consider it anymore\n\t\t\t\t\t(*networkPointer)[case0].InfectiveDays[day] = -1\n\n\t\t\t\t} else if (*networkPointer)[case0].InfectiveDays[day] > 0 {\n\t\t\t\t\t(*networkPointer)[case0].InfectiveDays[day]--\n\t\t\t\t}\n\t\t\t}\n\t\t\t// make time pass and reduce the remaining infective days\n\t\t\t_ = reduceInfectiveEpochs(&(*networkPointer)[case0], ssnPointer, uint32(case0))\n\n\t\t} else {\n\t\t\tinfected := getInfected(networkPointer)\n\n\t\t\tfor _, infectedID := range infected {\n\n\t\t\t\tinfectiveDaysLen := len((*networkPointer)[infectedID].InfectiveDays)\n\n\t\t\t\tfor day := 0; day < infectiveDaysLen; day++ {\n\t\t\t\t\tif (*networkPointer)[infectedID].InfectiveDays[day] == 0 {\n\n\t\t\t\t\t\tisInfected, infected := middlewareContainmentMeasure(&(*networkPointer)[infectedID], muskPointer, socialDistancePointer, epoch)\n\n\t\t\t\t\t\tif isInfected {\n\t\t\t\t\t\t\tif (*networkPointer)[infected].Infective == false &&\n\t\t\t\t\t\t\t\t(*networkPointer)[infected].Dead == false &&\n\t\t\t\t\t\t\t\t(*networkPointer)[infected].Survived == false &&\n\t\t\t\t\t\t\t\t(*networkPointer)[infected].InfectiveEpochs > 0 {\n\n\t\t\t\t\t\t\t\t// Check if Healthcare is neeeded\n\t\t\t\t\t\t\t\trequireHealthcare, typeHealthcare := bernoulliHealthcare(pIntensiveCare, pSubIntensiveCare)\n\t\t\t\t\t\t\t\tif requireHealthcare {\n\t\t\t\t\t\t\t\t\t// if Healthcare needed, check if there are bed available\n\t\t\t\t\t\t\t\t\taddedToSSN := addToSSN(ssnPointer, uint32(infected), typeHealthcare)\n\t\t\t\t\t\t\t\t\tif addedToSSN {\n\t\t\t\t\t\t\t\t\t\t// if added to SSN can still infect others\n\t\t\t\t\t\t\t\t\t\t(*networkPointer)[infected].Infective = true\n\t\t\t\t\t\t\t\t\t\t(*networkPointer)[infected].InfectiveEpochs += hospitalDays\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t//log.Println(\"NO BED AVAILABLE\")\n\t\t\t\t\t\t\t\t\t\t// if not possible to add to SSN the patient is dead\n\t\t\t\t\t\t\t\t\t\t(*networkPointer)[infected].InfectiveEpochs = 0\n\t\t\t\t\t\t\t\t\t\t(*networkPointer)[infected].Dead = true\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t(*networkPointer)[infected].Infective = true\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// I set to -1 in order to not consider it anymore\n\t\t\t\t\t\t(*networkPointer)[infectedID].InfectiveDays[day] = -1\n\t\t\t\t\t} else if (*networkPointer)[infectedID].InfectiveDays[day] > 0 {\n\t\t\t\t\t\t(*networkPointer)[infectedID].InfectiveDays[day]--\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// make time pass and reduce the remaining infective days\n\t\t\t\t_ = reduceInfectiveEpochs(&(*networkPointer)[infectedID], ssnPointer, uint32(infectedID))\n\t\t\t}\n\t\t}\n\n\t\tinfectNumber := countInfected(networkPointer, true, false, false)\n\t\tlog.Println(\"EPOCH\\t\", epoch,\n\t\t\t\"\\tACTIVE:\\t\", infectNumber,\n\t\t\t\"\\t\\tINT.CARE:\\t\", len((*ssnPointer).intensiveCareHospitalization),\n\t\t\t\"\\tSUB.INT.CARE:\", len((*ssnPointer).subIntensiveCareHospitalization))\n\n\t\t// number of infected today\n\t\t(*epochsResultsPointer)[epoch][0] = infectNumber\n\t\t// new number of infected today regards yesterday\n\t\tif epoch != 0 {\n\t\t\tlastInfected := (*epochsResultsPointer)[epoch-1][0]\n\t\t\t(*epochsResultsPointer)[epoch][1] = infectNumber - int(lastInfected)\n\t\t} else {\n\t\t\t(*epochsResultsPointer)[epoch][1] = infectNumber\n\t\t}\n\n\t\t// number of total infected\n\t\t(*epochsResultsPointer)[epoch][2] = countTotalInfected(networkPointer)\n\t\t// number of total recovered\n\t\t(*epochsResultsPointer)[epoch][3] = countInfected(networkPointer, false, true, false)\n\t\t// number of total deaths\n\t\t(*epochsResultsPointer)[epoch][4] = countInfected(networkPointer, false, false, true)\n\n\t\t// number of intensive care\n\t\t(*ssnEpochResults)[epoch][0] = len((*ssnPointer).intensiveCareHospitalization)\n\t\t// number of sub intensive care\n\t\t(*ssnEpochResults)[epoch][1] = len((*ssnPointer).subIntensiveCareHospitalization)\n\n\t\truntime.GC()\n\t}\n\n\t// assign number of total infected to col 0 of trial\n\t(*trialsResultsPointer)[trial][0] = countTotalInfected(networkPointer)\n\t// assign number of total recovered to col 1 of trial\n\t(*trialsResultsPointer)[trial][1] = countInfected(networkPointer, false, true, false)\n\t// assign number of total deaths to col 2 of trial\n\t(*trialsResultsPointer)[trial][2] = countInfected(networkPointer, false, false, true)\n\n\treturn nil\n}",
"func DTRSM(SIDE *byte, UPLO *byte, TRANSA *byte, DIAG *byte, M *int, N *int, ALPHA *float64, A *[][]float64, LDA *int, B *[][]float64, LDB *int) {\n\tvar TEMP float64\n\tvar I int\n\tvar INFO int\n\tvar J int\n\tvar K int\n\tvar NROWA int\n\tvar LSIDE bool\n\tvar NOUNIT bool\n\tvar UPPER bool\n\tvar ONE float64 = 1.0e+0\n\tvar ZERO float64 = 0.0e+0\n\t//*\n\t//* -- Reference BLAS level3 routine (version 3.7.0) --\n\t//* -- Reference BLAS is a software package provided by Univ. of Tennessee, --\n\t//* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--\n\t//* December 2016\n\t//*\n\t//* .. Scalar Arguments ..\n\t//* ..\n\t//* .. Array Arguments ..\n\t//* ..\n\t//*\n\t//* =====================================================================\n\t//*\n\t//* .. External Functions ..\n\t//* ..\n\t//* .. External Subroutines ..\n\t//* ..\n\t//* .. Intrinsic Functions ..\n\t//* ..\n\t//* .. Local Scalars ..\n\t//* ..\n\t//* .. Parameters ..\n\t//* ..\n\t//*\n\t//* Test the input parameters.\n\t//*\n\tLSIDE = LSAME(SIDE, func() *byte { y := byte('L'); return &y }())\n\tif LSIDE {\n\t\tNROWA = (*M)\n\t} else {\n\t\tNROWA = (*N)\n\t}\n\tNOUNIT = LSAME(DIAG, func() *byte { y := byte('N'); return &y }())\n\tUPPER = LSAME(UPLO, func() *byte { y := byte('U'); return &y }())\n\t//*\n\tINFO = 0\n\tif (!LSIDE) && (!LSAME(SIDE, func() *byte { y := byte('R'); return &y }())) {\n\t\tINFO = 1\n\t} else if (!UPPER) && (!LSAME(UPLO, func() *byte { y := byte('L'); return &y }())) {\n\t\tINFO = 2\n\t} else if (!LSAME(TRANSA, func() *byte { y := byte('N'); return &y }())) && (!LSAME(TRANSA, func() *byte { y := byte('T'); return &y }())) && (!LSAME(TRANSA, func() *byte { y := byte('C'); return &y }())) {\n\t\tINFO = 3\n\t} else if (!LSAME(DIAG, func() *byte { y := byte('U'); return &y }())) && (!LSAME(DIAG, func() *byte { y := byte('N'); return &y }())) {\n\t\tINFO = 4\n\t} else if (*M) < 0 {\n\t\tINFO = 5\n\t} else if (*N) < 0 {\n\t\tINFO = 6\n\t} else if (*LDA) < intrinsic.MAX(int(1), NROWA) {\n\t\tINFO = 9\n\t} else if (*LDB) < intrinsic.MAX(int(1), (*M)) {\n\t\tINFO = 11\n\t}\n\tif INFO != 0 {\n\t\tXERBLA(func() *[]byte { y := []byte(\"DTRSM \"); return &y }(), &(INFO))\n\t\treturn\n\t}\n\t//*\n\t//* Quick return if possible.\n\t//*\n\tif (*M) == 0 || (*N) == 0 {\n\t\treturn\n\t}\n\t//*\n\t//* And when alpha.eq.zero.\n\t//*\n\tif (*ALPHA) == ZERO {\n\t\tfor J = 1; J <= (*N); J++ {\n\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t(*B)[I-(1)][J-(1)] = ZERO\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\t//*\n\t//* Start the operations.\n\t//*\n\tif LSIDE {\n\t\tif LSAME(TRANSA, func() *byte { y := byte('N'); return &y }()) {\n\t\t\t//*\n\t\t\t//* Form B := alpha*inv( A )*B.\n\t\t\t//*\n\t\t\tif UPPER {\n\t\t\t\tfor J = 1; J <= (*N); J++ {\n\t\t\t\t\tif (*ALPHA) != ONE {\n\t\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t(*B)[I-(1)][J-(1)] = (*ALPHA) * (*B)[I-(1)][J-(1)]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor K = (*M); K <= 1; K += -1 {\n\t\t\t\t\t\tif (*B)[K-(1)][J-(1)] != ZERO {\n\t\t\t\t\t\t\tif NOUNIT {\n\t\t\t\t\t\t\t\t(*B)[K-(1)][J-(1)] = (*B)[K-(1)][J-(1)] / (*A)[K-(1)][K-(1)]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor I = 1; I <= K-1; I++ {\n\t\t\t\t\t\t\t\t(*B)[I-(1)][J-(1)] = (*B)[I-(1)][J-(1)] - (*B)[K-(1)][J-(1)]*(*A)[I-(1)][K-(1)]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor J = 1; J <= (*N); J++ {\n\t\t\t\t\tif (*ALPHA) != ONE {\n\t\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t(*B)[I-(1)][J-(1)] = (*ALPHA) * (*B)[I-(1)][J-(1)]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor K = 1; K <= (*M); K++ {\n\t\t\t\t\t\tif (*B)[K-(1)][J-(1)] != ZERO {\n\t\t\t\t\t\t\tif NOUNIT {\n\t\t\t\t\t\t\t\t(*B)[K-(1)][J-(1)] = (*B)[K-(1)][J-(1)] / (*A)[K-(1)][K-(1)]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor I = K + 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t\t(*B)[I-(1)][J-(1)] = (*B)[I-(1)][J-(1)] - (*B)[K-(1)][J-(1)]*(*A)[I-(1)][K-(1)]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t//*\n\t\t\t//* Form B := alpha*inv( A**T )*B.\n\t\t\t//*\n\t\t\tif UPPER {\n\t\t\t\tfor J = 1; J <= (*N); J++ {\n\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\tTEMP = (*ALPHA) * (*B)[I-(1)][J-(1)]\n\t\t\t\t\t\tfor K = 1; K <= I-1; K++ {\n\t\t\t\t\t\t\tTEMP = TEMP - (*A)[K-(1)][I-(1)]*(*B)[K-(1)][J-(1)]\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif NOUNIT {\n\t\t\t\t\t\t\tTEMP = TEMP / (*A)[I-(1)][I-(1)]\n\t\t\t\t\t\t}\n\t\t\t\t\t\t(*B)[I-(1)][J-(1)] = TEMP\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor J = 1; J <= (*N); J++ {\n\t\t\t\t\tfor I = (*M); I <= 1; I += -1 {\n\t\t\t\t\t\tTEMP = (*ALPHA) * (*B)[I-(1)][J-(1)]\n\t\t\t\t\t\tfor K = I + 1; K <= (*M); K++ {\n\t\t\t\t\t\t\tTEMP = TEMP - (*A)[K-(1)][I-(1)]*(*B)[K-(1)][J-(1)]\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif NOUNIT {\n\t\t\t\t\t\t\tTEMP = TEMP / (*A)[I-(1)][I-(1)]\n\t\t\t\t\t\t}\n\t\t\t\t\t\t(*B)[I-(1)][J-(1)] = TEMP\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif LSAME(TRANSA, func() *byte { y := byte('N'); return &y }()) {\n\t\t\t//*\n\t\t\t//* Form B := alpha*B*inv( A ).\n\t\t\t//*\n\t\t\tif UPPER {\n\t\t\t\tfor J = 1; J <= (*N); J++ {\n\t\t\t\t\tif (*ALPHA) != ONE {\n\t\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t(*B)[I-(1)][J-(1)] = (*ALPHA) * (*B)[I-(1)][J-(1)]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor K = 1; K <= J-1; K++ {\n\t\t\t\t\t\tif (*A)[K-(1)][J-(1)] != ZERO {\n\t\t\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t\t(*B)[I-(1)][J-(1)] = (*B)[I-(1)][J-(1)] - (*A)[K-(1)][J-(1)]*(*B)[I-(1)][K-(1)]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif NOUNIT {\n\t\t\t\t\t\tTEMP = ONE / (*A)[J-(1)][J-(1)]\n\t\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t(*B)[I-(1)][J-(1)] = TEMP * (*B)[I-(1)][J-(1)]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor J = (*N); J <= 1; J += -1 {\n\t\t\t\t\tif (*ALPHA) != ONE {\n\t\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t(*B)[I-(1)][J-(1)] = (*ALPHA) * (*B)[I-(1)][J-(1)]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor K = J + 1; K <= (*N); K++ {\n\t\t\t\t\t\tif (*A)[K-(1)][J-(1)] != ZERO {\n\t\t\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t\t(*B)[I-(1)][J-(1)] = (*B)[I-(1)][J-(1)] - (*A)[K-(1)][J-(1)]*(*B)[I-(1)][K-(1)]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif NOUNIT {\n\t\t\t\t\t\tTEMP = ONE / (*A)[J-(1)][J-(1)]\n\t\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t(*B)[I-(1)][J-(1)] = TEMP * (*B)[I-(1)][J-(1)]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t//*\n\t\t\t//* Form B := alpha*B*inv( A**T ).\n\t\t\t//*\n\t\t\tif UPPER {\n\t\t\t\tfor K = (*N); K <= 1; K += -1 {\n\t\t\t\t\tif NOUNIT {\n\t\t\t\t\t\tTEMP = ONE / (*A)[K-(1)][K-(1)]\n\t\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t(*B)[I-(1)][K-(1)] = TEMP * (*B)[I-(1)][K-(1)]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor J = 1; J <= K-1; J++ {\n\t\t\t\t\t\tif (*A)[J-(1)][K-(1)] != ZERO {\n\t\t\t\t\t\t\tTEMP = (*A)[J-(1)][K-(1)]\n\t\t\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t\t(*B)[I-(1)][J-(1)] = (*B)[I-(1)][J-(1)] - TEMP*(*B)[I-(1)][K-(1)]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (*ALPHA) != ONE {\n\t\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t(*B)[I-(1)][K-(1)] = (*ALPHA) * (*B)[I-(1)][K-(1)]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor K = 1; K <= (*N); K++ {\n\t\t\t\t\tif NOUNIT {\n\t\t\t\t\t\tTEMP = ONE / (*A)[K-(1)][K-(1)]\n\t\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t(*B)[I-(1)][K-(1)] = TEMP * (*B)[I-(1)][K-(1)]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor J = K + 1; J <= (*N); J++ {\n\t\t\t\t\t\tif (*A)[J-(1)][K-(1)] != ZERO {\n\t\t\t\t\t\t\tTEMP = (*A)[J-(1)][K-(1)]\n\t\t\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t\t(*B)[I-(1)][J-(1)] = (*B)[I-(1)][J-(1)] - TEMP*(*B)[I-(1)][K-(1)]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (*ALPHA) != ONE {\n\t\t\t\t\t\tfor I = 1; I <= (*M); I++ {\n\t\t\t\t\t\t\t(*B)[I-(1)][K-(1)] = (*ALPHA) * (*B)[I-(1)][K-(1)]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//*\n\treturn\n\t//*\n\t//* End of DTRSM .\n\t//*\n}",
"func Zhetd2(uplo mat.MatUplo, n int, a *mat.CMatrix, d, e *mat.Vector, tau *mat.CVector) (err error) {\n\tvar upper bool\n\tvar alpha, half, one, taui, zero complex128\n\tvar i int\n\n\tone = (1.0 + 0.0*1i)\n\tzero = (0.0 + 0.0*1i)\n\thalf = (0.5 + 0.0*1i)\n\n\t// Test the input parameters\n\tupper = uplo == Upper\n\tif !upper && uplo != Lower {\n\t\terr = fmt.Errorf(\"!upper && uplo != Lower: uplo=%s\", uplo)\n\t} else if n < 0 {\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if a.Rows < max(1, n) {\n\t\terr = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=%v, n=%v\", a.Rows, n)\n\t}\n\tif err != nil {\n\t\tgltest.Xerbla2(\"Zhetd2\", err)\n\t\treturn\n\t}\n\n\t// Quick return if possible\n\tif n <= 0 {\n\t\treturn\n\t}\n\n\tif upper {\n\t\t// Reduce the upper triangle of A\n\t\ta.Set(n-1, n-1, a.GetReCmplx(n-1, n-1))\n\t\tfor i = n - 1; i >= 1; i-- { //\n\t\t\t// Generate elementary reflector H(i) = I - tau * v * v**H\n\t\t\t// to annihilate A(1:i-1,i+1)\n\t\t\talpha = a.Get(i-1, i)\n\t\t\talpha, taui = Zlarfg(i, alpha, a.Off(0, i).CVector(), 1)\n\t\t\te.Set(i-1, real(alpha))\n\n\t\t\tif taui != zero {\n\t\t\t\t// Apply H(i) from both sides to A(1:i,1:i)\n\t\t\t\ta.Set(i-1, i, one)\n\n\t\t\t\t// Compute x := tau * A * v storing x in TAU(1:i)\n\t\t\t\tif err = tau.Hemv(uplo, i, taui, a, a.Off(0, i).CVector(), 1, zero, 1); err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\n\t\t\t\t// Compute w := x - 1/2 * tau * (x**H * v) * v\n\t\t\t\talpha = -half * taui * a.Off(0, i).CVector().Dotc(i, tau, 1, 1)\n\t\t\t\ttau.Axpy(i, alpha, a.Off(0, i).CVector(), 1, 1)\n\n\t\t\t\t// Apply the transformation as a rank-2 update:\n\t\t\t\t// A := A - v * w**H - w * v**H\n\t\t\t\tif err = a.Her2(uplo, i, -one, a.Off(0, i).CVector(), 1, tau, 1); err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\ta.Set(i-1, i-1, a.GetReCmplx(i-1, i-1))\n\t\t\t}\n\t\t\ta.Set(i-1, i, e.GetCmplx(i-1))\n\t\t\td.Set(i, a.GetRe(i, i))\n\t\t\ttau.Set(i-1, taui)\n\t\t}\n\t\td.Set(0, a.GetRe(0, 0))\n\t} else {\n\t\t// Reduce the lower triangle of A\n\t\ta.Set(0, 0, a.GetReCmplx(0, 0))\n\t\tfor i = 1; i <= n-1; i++ {\n\t\t\t// Generate elementary reflector H(i) = I - tau * v * v**H\n\t\t\t// to annihilate A(i+2:n,i)\n\t\t\talpha = a.Get(i, i-1)\n\t\t\talpha, taui = Zlarfg(n-i, alpha, a.Off(min(i+2, n)-1, i-1).CVector(), 1)\n\t\t\te.Set(i-1, real(alpha))\n\n\t\t\tif taui != zero {\n\t\t\t\t// Apply H(i) from both sides to A(i+1:n,i+1:n)\n\t\t\t\ta.Set(i, i-1, one)\n\n\t\t\t\t// Compute x := tau * A * v storing y in TAU(i:n-1)\n\t\t\t\tif err = tau.Off(i-1).Hemv(uplo, n-i, taui, a.Off(i, i), a.Off(i, i-1).CVector(), 1, zero, 1); err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\n\t\t\t\t// Compute w := x - 1/2 * tau * (x**H * v) * v\n\t\t\t\talpha = -half * taui * a.Off(i, i-1).CVector().Dotc(n-i, tau.Off(i-1), 1, 1)\n\t\t\t\ttau.Off(i-1).Axpy(n-i, alpha, a.Off(i, i-1).CVector(), 1, 1)\n\n\t\t\t\t// Apply the transformation as a rank-2 update:\n\t\t\t\t// A := A - v * w**H - w * v**H\n\t\t\t\tif err = a.Off(i, i).Her2(uplo, n-i, -one, a.Off(i, i-1).CVector(), 1, tau.Off(i-1), 1); err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\ta.Set(i, i, a.GetReCmplx(i, i))\n\t\t\t}\n\t\t\ta.Set(i, i-1, e.GetCmplx(i-1))\n\t\t\td.Set(i-1, a.GetRe(i-1, i-1))\n\t\t\ttau.Set(i-1, taui)\n\t\t}\n\t\td.Set(n-1, a.GetRe(n-1, n-1))\n\t}\n\n\treturn\n}",
"func zdrvev(nsizes int, nn []int, ntypes int, dotype []bool, iseed []int, thresh float64, a, h *mat.CMatrix, w, w1 *mat.CVector, vl, vr, lre *mat.CMatrix, result *mat.Vector, work *mat.CVector, nwork int, rwork *mat.Vector, iwork []int) (nerrs, ntestt int, err error) {\n\tvar badnn bool\n\tvar cone, czero complex128\n\tvar anorm, cond, conds, one, ovfl, rtulp, rtulpi, tnrm, two, ulp, ulpinv, unfl, vmx, vrmx, vtst, zero float64\n\tvar iinfo, imode, itype, iwk, j, jcol, jj, jsize, jtype, maxtyp, mtypes, n, nfail, nmax, nnwork, ntest, ntestf int\n\tdum := cvf(1)\n\tres := vf(2)\n\tidumma := make([]int, 1)\n\tioldsd := make([]int, 4)\n\tkconds := []int{0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 0, 0, 0}\n\tkmagn := []int{1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 3}\n\tkmode := []int{0, 0, 0, 4, 3, 1, 4, 4, 4, 3, 1, 5, 4, 3, 1, 5, 5, 5, 4, 3, 1}\n\tktype := []int{1, 2, 3, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 9, 9, 9}\n\n\tczero = (0.0 + 0.0*1i)\n\tcone = (1.0 + 0.0*1i)\n\tzero = 0.0\n\tone = 1.0\n\ttwo = 2.0\n\tmaxtyp = 21\n\n\tpath := \"Zev\"\n\n\t// Check for errors\n\tntestt = 0\n\tntestf = 0\n\n\t// Important constants\n\tbadnn = false\n\tnmax = 0\n\tfor j = 1; j <= nsizes; j++ {\n\t\tnmax = max(nmax, nn[j-1])\n\t\tif nn[j-1] < 0 {\n\t\t\tbadnn = true\n\t\t}\n\t}\n\n\t// Check for errors\n\tif nsizes < 0 {\n\t\terr = fmt.Errorf(\"nsizes < 0: nsizes=%v\", nsizes)\n\t} else if badnn {\n\t\terr = fmt.Errorf(\"badnn: nn=%v\", nn)\n\t} else if ntypes < 0 {\n\t\terr = fmt.Errorf(\"ntypes < 0: ntypes=%v\", ntypes)\n\t} else if thresh < zero {\n\t\terr = fmt.Errorf(\"thresh < zero: thresh=%v\", thresh)\n\t} else if a.Rows < 1 || a.Rows < nmax {\n\t\terr = fmt.Errorf(\"a.Rows < 1 || a.Rows < nmax: a.Rows=%v, nmax=%v\", a.Rows, nmax)\n\t} else if vl.Rows < 1 || vl.Rows < nmax {\n\t\terr = fmt.Errorf(\"vl.Rows < 1 || vl.Rows < nmax: vl.Rows=%v, nmax=%v\", vl.Rows, nmax)\n\t} else if vr.Rows < 1 || vr.Rows < nmax {\n\t\terr = fmt.Errorf(\"vr.Rows < 1 || vr.Rows < nmax: vr.Rows=%v, nmax=%v\", vr.Rows, nmax)\n\t} else if lre.Rows < 1 || lre.Rows < nmax {\n\t\terr = fmt.Errorf(\"lre.Rows < 1 || lre.Rows < nmax: lre.Rows=%v, nmax=%v\", lre.Rows, nmax)\n\t} else if 5*nmax+2*pow(nmax, 2) > nwork {\n\t\terr = fmt.Errorf(\"5*nmax+2*pow(nmax, 2) > nwork: nmax=%v, nwork=%v\", nmax, nwork)\n\t}\n\n\tif err != nil {\n\t\tgltest.Xerbla2(\"zdrvev\", err)\n\t\treturn\n\t}\n\n\t// Quick return if nothing to do\n\tif nsizes == 0 || ntypes == 0 {\n\t\treturn\n\t}\n\n\t// More Important constants\n\tunfl = golapack.Dlamch(SafeMinimum)\n\tovfl = one / unfl\n\tunfl, ovfl = golapack.Dlabad(unfl, ovfl)\n\tulp = golapack.Dlamch(Precision)\n\tulpinv = one / ulp\n\trtulp = math.Sqrt(ulp)\n\trtulpi = one / rtulp\n\n\t// Loop over sizes, types\n\tnerrs = 0\n\n\tfor jsize = 1; jsize <= nsizes; jsize++ {\n\t\tn = nn[jsize-1]\n\t\tif nsizes != 1 {\n\t\t\tmtypes = min(maxtyp, ntypes)\n\t\t} else {\n\t\t\tmtypes = min(maxtyp+1, ntypes)\n\t\t}\n\n\t\tfor jtype = 1; jtype <= mtypes; jtype++ {\n\t\t\tif !dotype[jtype-1] {\n\t\t\t\tgoto label260\n\t\t\t}\n\n\t\t\t// Save iseed in case of an error.\n\t\t\tfor j = 1; j <= 4; j++ {\n\t\t\t\tioldsd[j-1] = iseed[j-1]\n\t\t\t}\n\n\t\t\t// Compute \"A\"\n\t\t\t//\n\t\t\t// Control parameters:\n\t\t\t//\n\t\t\t// KMAGN KCONDS KMODE KTYPE\n\t\t\t// =1 O(1) 1 clustered 1 zero\n\t\t\t// =2 large large clustered 2 identity\n\t\t\t// =3 small exponential Jordan\n\t\t\t// =4 arithmetic diagonal, (w/ eigenvalues)\n\t\t\t// =5 random log symmetric, w/ eigenvalues\n\t\t\t// =6 random general, w/ eigenvalues\n\t\t\t// =7 random diagonal\n\t\t\t// =8 random symmetric\n\t\t\t// =9 random general\n\t\t\t// =10 random triangular\n\t\t\tif mtypes > maxtyp {\n\t\t\t\tgoto label90\n\t\t\t}\n\n\t\t\titype = ktype[jtype-1]\n\t\t\timode = kmode[jtype-1]\n\n\t\t\t// Compute norm\n\t\t\tswitch kmagn[jtype-1] {\n\t\t\tcase 1:\n\t\t\t\tgoto label30\n\t\t\tcase 2:\n\t\t\t\tgoto label40\n\t\t\tcase 3:\n\t\t\t\tgoto label50\n\t\t\t}\n\n\t\tlabel30:\n\t\t\t;\n\t\t\tanorm = one\n\t\t\tgoto label60\n\n\t\tlabel40:\n\t\t\t;\n\t\t\tanorm = ovfl * ulp\n\t\t\tgoto label60\n\n\t\tlabel50:\n\t\t\t;\n\t\t\tanorm = unfl * ulpinv\n\t\t\tgoto label60\n\n\t\tlabel60:\n\t\t\t;\n\n\t\t\tgolapack.Zlaset(Full, a.Rows, n, czero, czero, a)\n\t\t\tiinfo = 0\n\t\t\tcond = ulpinv\n\n\t\t\t// Special Matrices -- Identity & Jordan block\n\t\t\t//\n\t\t\t// Zero\n\t\t\tif itype == 1 {\n\t\t\t\tiinfo = 0\n\n\t\t\t} else if itype == 2 {\n\t\t\t\t// Identity\n\t\t\t\tfor jcol = 1; jcol <= n; jcol++ {\n\t\t\t\t\ta.SetRe(jcol-1, jcol-1, anorm)\n\t\t\t\t}\n\n\t\t\t} else if itype == 3 {\n\t\t\t\t// Jordan Block\n\t\t\t\tfor jcol = 1; jcol <= n; jcol++ {\n\t\t\t\t\ta.SetRe(jcol-1, jcol-1, anorm)\n\t\t\t\t\tif jcol > 1 {\n\t\t\t\t\t\ta.Set(jcol-1, jcol-1-1, cone)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else if itype == 4 {\n\t\t\t\t// Diagonal Matrix, [Eigen]values Specified\n\t\t\t\terr = matgen.Zlatms(n, n, 'S', &iseed, 'H', rwork, imode, cond, anorm, 0, 0, 'N', a, work.Off(n))\n\n\t\t\t} else if itype == 5 {\n\t\t\t\t// Hermitian, eigenvalues specified\n\t\t\t\terr = matgen.Zlatms(n, n, 'S', &iseed, 'H', rwork, imode, cond, anorm, n, n, 'N', a, work.Off(n))\n\n\t\t\t} else if itype == 6 {\n\t\t\t\t// General, eigenvalues specified\n\t\t\t\tif kconds[jtype-1] == 1 {\n\t\t\t\t\tconds = one\n\t\t\t\t} else if kconds[jtype-1] == 2 {\n\t\t\t\t\tconds = rtulpi\n\t\t\t\t} else {\n\t\t\t\t\tconds = zero\n\t\t\t\t}\n\n\t\t\t\terr = matgen.Zlatme(n, 'D', &iseed, work, imode, cond, cone, 'T', 'T', 'T', rwork, 4, conds, n, n, anorm, a, work.Off(2*n))\n\n\t\t\t} else if itype == 7 {\n\t\t\t\t// Diagonal, random eigenvalues\n\t\t\t\terr = matgen.Zlatmr(n, n, 'D', &iseed, 'N', work, 6, one, cone, 'T', 'N', work.Off(n), 1, one, work.Off(2*n), 1, one, 'N', &idumma, 0, 0, zero, anorm, 'N', a, &iwork)\n\n\t\t\t} else if itype == 8 {\n\t\t\t\t// Symmetric, random eigenvalues\n\t\t\t\terr = matgen.Zlatmr(n, n, 'D', &iseed, 'H', work, 6, one, cone, 'T', 'N', work.Off(n), 1, one, work.Off(2*n), 1, one, 'N', &idumma, n, n, zero, anorm, 'N', a, &iwork)\n\n\t\t\t} else if itype == 9 {\n\t\t\t\t// General, random eigenvalues\n\t\t\t\terr = matgen.Zlatmr(n, n, 'D', &iseed, 'N', work, 6, one, cone, 'T', 'N', work.Off(n), 1, one, work.Off(2*n), 1, one, 'N', &idumma, n, n, zero, anorm, 'N', a, &iwork)\n\t\t\t\tif n >= 4 {\n\t\t\t\t\tgolapack.Zlaset(Full, 2, n, czero, czero, a)\n\t\t\t\t\tgolapack.Zlaset(Full, n-3, 1, czero, czero, a.Off(2, 0))\n\t\t\t\t\tgolapack.Zlaset(Full, n-3, 2, czero, czero, a.Off(2, n-1-1))\n\t\t\t\t\tgolapack.Zlaset(Full, 1, n, czero, czero, a.Off(n-1, 0))\n\t\t\t\t}\n\n\t\t\t} else if itype == 10 {\n\t\t\t\t// Triangular, random eigenvalues\n\t\t\t\terr = matgen.Zlatmr(n, n, 'D', &iseed, 'N', work, 6, one, cone, 'T', 'N', work.Off(n), 1, one, work.Off(2*n), 1, one, 'N', &idumma, n, 0, zero, anorm, 'N', a, &iwork)\n\n\t\t\t} else {\n\n\t\t\t\tiinfo = 1\n\t\t\t}\n\n\t\t\tif iinfo != 0 || err != nil {\n\t\t\t\tfmt.Printf(\" zdrvev: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Generator\", iinfo, n, jtype, ioldsd)\n\t\t\t\terr = fmt.Errorf(\"iinfo=%v\", abs(iinfo))\n\t\t\t\treturn\n\t\t\t}\n\n\t\tlabel90:\n\t\t\t;\n\n\t\t\t// Test for minimal and generous workspace\n\t\t\tfor iwk = 1; iwk <= 2; iwk++ {\n\t\t\t\tif iwk == 1 {\n\t\t\t\t\tnnwork = 2 * n\n\t\t\t\t} else {\n\t\t\t\t\tnnwork = 5*n + 2*pow(n, 2)\n\t\t\t\t}\n\t\t\t\tnnwork = max(nnwork, 1)\n\n\t\t\t\t// Initialize RESULT\n\t\t\t\tfor j = 1; j <= 7; j++ {\n\t\t\t\t\tresult.Set(j-1, -one)\n\t\t\t\t}\n\n\t\t\t\t// Compute eigenvalues and eigenvectors, and test them\n\t\t\t\tgolapack.Zlacpy(Full, n, n, a, h)\n\t\t\t\tif iinfo, err = golapack.Zgeev('V', 'V', n, h, w, vl, vr, work, nnwork, rwork); err != nil || iinfo != 0 {\n\t\t\t\t\tresult.Set(0, ulpinv)\n\t\t\t\t\tfmt.Printf(\" zdrvev: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Zgeev1\", iinfo, n, jtype, ioldsd)\n\t\t\t\t\terr = fmt.Errorf(\"iinfo=%v\", abs(iinfo))\n\t\t\t\t\tgoto label220\n\t\t\t\t}\n\n\t\t\t\t// Do Test (1)\n\t\t\t\tzget22(NoTrans, NoTrans, NoTrans, n, a, vr, w, work, rwork, res)\n\t\t\t\tresult.Set(0, res.Get(0))\n\n\t\t\t\t// Do Test (2)\n\t\t\t\tzget22(ConjTrans, NoTrans, ConjTrans, n, a, vl, w, work, rwork, res)\n\t\t\t\tresult.Set(1, res.Get(0))\n\n\t\t\t\t// Do Test (3)\n\t\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\t\ttnrm = vr.Off(0, j-1).CVector().Nrm2(n, 1)\n\t\t\t\t\tresult.Set(2, math.Max(result.Get(2), math.Min(ulpinv, math.Abs(tnrm-one)/ulp)))\n\t\t\t\t\tvmx = zero\n\t\t\t\t\tvrmx = zero\n\t\t\t\t\tfor jj = 1; jj <= n; jj++ {\n\t\t\t\t\t\tvtst = vr.GetMag(jj-1, j-1)\n\t\t\t\t\t\tif vtst > vmx {\n\t\t\t\t\t\t\tvmx = vtst\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif vr.GetIm(jj-1, j-1) == zero && math.Abs(vr.GetRe(jj-1, j-1)) > vrmx {\n\t\t\t\t\t\t\tvrmx = math.Abs(vr.GetRe(jj-1, j-1))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif vrmx/vmx < one-two*ulp {\n\t\t\t\t\t\tresult.Set(2, ulpinv)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Do Test (4)\n\t\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\t\ttnrm = vl.Off(0, j-1).CVector().Nrm2(n, 1)\n\t\t\t\t\tresult.Set(3, math.Max(result.Get(3), math.Min(ulpinv, math.Abs(tnrm-one)/ulp)))\n\t\t\t\t\tvmx = zero\n\t\t\t\t\tvrmx = zero\n\t\t\t\t\tfor jj = 1; jj <= n; jj++ {\n\t\t\t\t\t\tvtst = vl.GetMag(jj-1, j-1)\n\t\t\t\t\t\tif vtst > vmx {\n\t\t\t\t\t\t\tvmx = vtst\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif vl.GetIm(jj-1, j-1) == zero && math.Abs(vl.GetRe(jj-1, j-1)) > vrmx {\n\t\t\t\t\t\t\tvrmx = math.Abs(vl.GetRe(jj-1, j-1))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif vrmx/vmx < one-two*ulp {\n\t\t\t\t\t\tresult.Set(3, ulpinv)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Compute eigenvalues only, and test them\n\t\t\t\tgolapack.Zlacpy(Full, n, n, a, h)\n\t\t\t\tif iinfo, err = golapack.Zgeev('N', 'N', n, h, w1, dum.CMatrix(1, opts), dum.CMatrix(1, opts), work, nnwork, rwork); err != nil || iinfo != 0 {\n\t\t\t\t\tresult.Set(0, ulpinv)\n\t\t\t\t\tfmt.Printf(\" zdrvev: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Zgeev2\", iinfo, n, jtype, ioldsd)\n\t\t\t\t\terr = fmt.Errorf(\"iinfo=%v\", abs(iinfo))\n\t\t\t\t\tgoto label220\n\t\t\t\t}\n\n\t\t\t\t// Do Test (5)\n\t\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\t\tif w.Get(j-1) != w1.Get(j-1) {\n\t\t\t\t\t\tresult.Set(4, ulpinv)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Compute eigenvalues and right eigenvectors, and test them\n\t\t\t\tgolapack.Zlacpy(Full, n, n, a, h)\n\t\t\t\tif iinfo, err = golapack.Zgeev('N', 'V', n, h, w1, dum.CMatrix(1, opts), lre, work, nnwork, rwork); err != nil || iinfo != 0 {\n\t\t\t\t\tresult.Set(0, ulpinv)\n\t\t\t\t\tfmt.Printf(\" zdrvev: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Zgeev3\", iinfo, n, jtype, ioldsd)\n\t\t\t\t\terr = fmt.Errorf(\"iinfo=%v\", abs(iinfo))\n\t\t\t\t\tgoto label220\n\t\t\t\t}\n\n\t\t\t\t// Do Test (5) again\n\t\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\t\tif w.Get(j-1) != w1.Get(j-1) {\n\t\t\t\t\t\tresult.Set(4, ulpinv)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Do Test (6)\n\t\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\t\tfor jj = 1; jj <= n; jj++ {\n\t\t\t\t\t\tif vr.Get(j-1, jj-1) != lre.Get(j-1, jj-1) {\n\t\t\t\t\t\t\tresult.Set(5, ulpinv)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Compute eigenvalues and left eigenvectors, and test them\n\t\t\t\tgolapack.Zlacpy(Full, n, n, a, h)\n\t\t\t\tif iinfo, err = golapack.Zgeev('V', 'N', n, h, w1, lre, dum.CMatrix(1, opts), work, nnwork, rwork); err != nil || iinfo != 0 {\n\t\t\t\t\tresult.Set(0, ulpinv)\n\t\t\t\t\tfmt.Printf(\" zdrvev: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Zgeev4\", iinfo, n, jtype, ioldsd)\n\t\t\t\t\terr = fmt.Errorf(\"iinfo=%v\", abs(iinfo))\n\t\t\t\t\tgoto label220\n\t\t\t\t}\n\n\t\t\t\t// Do Test (5) again\n\t\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\t\tif w.Get(j-1) != w1.Get(j-1) {\n\t\t\t\t\t\tresult.Set(4, ulpinv)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Do Test (7)\n\t\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\t\tfor jj = 1; jj <= n; jj++ {\n\t\t\t\t\t\tif vl.Get(j-1, jj-1) != lre.Get(j-1, jj-1) {\n\t\t\t\t\t\t\tresult.Set(6, ulpinv)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// End of Loop -- Check for RESULT(j) > THRESH\n\t\t\tlabel220:\n\t\t\t\t;\n\n\t\t\t\tntest = 0\n\t\t\t\tnfail = 0\n\t\t\t\tfor j = 1; j <= 7; j++ {\n\t\t\t\t\tif result.Get(j-1) >= zero {\n\t\t\t\t\t\tntest = ntest + 1\n\t\t\t\t\t}\n\t\t\t\t\tif result.Get(j-1) >= thresh {\n\t\t\t\t\t\tnfail++\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif nfail > 0 {\n\t\t\t\t\tntestf = ntestf + 1\n\t\t\t\t}\n\t\t\t\tif ntestf == 1 {\n\t\t\t\t\tfmt.Printf(\"\\n %3s -- Complex Eigenvalue-Eigenvector Decomposition Driver\\n Matrix types (see zdrvev for details): \\n\", path)\n\t\t\t\t\tfmt.Printf(\"\\n Special Matrices:\\n 1=Zero matrix. 5=Diagonal: geometr. spaced entries.\\n 2=Identity matrix. 6=Diagonal: clustered entries.\\n 3=Transposed Jordan block. 7=Diagonal: large, evenly spaced.\\n 4=Diagonal: evenly spaced entries. 8=Diagonal: small, evenly spaced.\\n\")\n\t\t\t\t\tfmt.Printf(\" Dense, Non-Symmetric Matrices:\\n 9=Well-cond., evenly spaced eigenvals. 14=Ill-cond., geomet. spaced eigenals.\\n 10=Well-cond., geom. spaced eigenvals. 15=Ill-conditioned, clustered e.vals.\\n 11=Well-conditioned, clustered e.vals. 16=Ill-cond., random complex \\n 12=Well-cond., random complex 17=Ill-cond., large rand. complx \\n 13=Ill-conditioned, evenly spaced. 18=Ill-cond., small rand. complx \\n\")\n\t\t\t\t\tfmt.Printf(\" 19=Matrix with random O(1) entries. 21=Matrix with small random entries.\\n 20=Matrix with large random entries. \\n\\n\")\n\t\t\t\t\tfmt.Printf(\" Tests performed with test threshold =%8.2f\\n\\n 1 = | A VR - VR W | / ( n |A| ulp ) \\n 2 = | conj-trans(A) VL - VL conj-trans(W) | / ( n |A| ulp ) \\n 3 = | |VR(i)| - 1 | / ulp \\n 4 = | |VL(i)| - 1 | / ulp \\n 5 = 0 if W same no matter if VR or VL computed, 1/ulp otherwise\\n 6 = 0 if VR same no matter if VL computed, 1/ulp otherwise\\n 7 = 0 if VL same no matter if VR computed, 1/ulp otherwise\\n\\n\", thresh)\n\t\t\t\t\tntestf = 2\n\t\t\t\t}\n\n\t\t\t\tfor j = 1; j <= 7; j++ {\n\t\t\t\t\tif result.Get(j-1) >= thresh {\n\t\t\t\t\t\tfmt.Printf(\" n=%5d, IWK=%2d, seed=%4d, _type %2d, test(%2d)=%10.3f\\n\", n, iwk, ioldsd, jtype, j, result.Get(j-1))\n\t\t\t\t\t\terr = fmt.Errorf(\" n=%5d, IWK=%2d, seed=%4d, _type %2d, test(%2d)=%10.3f\\n\", n, iwk, ioldsd, jtype, j, result.Get(j-1))\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnerrs = nerrs + nfail\n\t\t\t\tntestt = ntestt + ntest\n\n\t\t\t}\n\t\tlabel260:\n\t\t}\n\t}\n\n\t// Summary\n\t// dlasum(path, nerrs, ntestt)\n\n\treturn\n}",
"func Zgeequ(m, n int, a *mat.CMatrix, r, c *mat.Vector) (rowcnd, colcnd, amax float64, info int, err error) {\n\tvar bignum, one, rcmax, rcmin, smlnum, zero float64\n\tvar i, j int\n\n\tone = 1.0\n\tzero = 0.0\n\n\t// Test the input parameters.\n\tif m < 0 {\n\t\terr = fmt.Errorf(\"m < 0: m=%v\", m)\n\t} else if n < 0 {\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if a.Rows < max(1, m) {\n\t\terr = fmt.Errorf(\"a.Rows < max(1, m): a.Rows=%v, m=%v\", a.Rows, m)\n\t}\n\tif err != nil {\n\t\tgltest.Xerbla2(\"Zgeequ\", err)\n\t\treturn\n\t}\n\n\t// Quick return if possible\n\tif m == 0 || n == 0 {\n\t\trowcnd = one\n\t\tcolcnd = one\n\t\tamax = zero\n\t\treturn\n\t}\n\n\t// Get machine constants.\n\tsmlnum = Dlamch(SafeMinimum)\n\tbignum = one / smlnum\n\n\t// Compute row scale factors.\n\tfor i = 1; i <= m; i++ {\n\t\tr.Set(i-1, zero)\n\t}\n\n\t// Find the maximum element in each row.\n\tfor j = 1; j <= n; j++ {\n\t\tfor i = 1; i <= m; i++ {\n\t\t\tr.Set(i-1, math.Max(r.Get(i-1), cabs1(a.Get(i-1, j-1))))\n\t\t}\n\t}\n\n\t// Find the maximum and minimum scale factors.\n\trcmin = bignum\n\trcmax = zero\n\tfor i = 1; i <= m; i++ {\n\t\trcmax = math.Max(rcmax, r.Get(i-1))\n\t\trcmin = math.Min(rcmin, r.Get(i-1))\n\t}\n\tamax = rcmax\n\n\tif rcmin == zero {\n\t\t// Find the first zero scale factor and return an error code.\n\t\tfor i = 1; i <= m; i++ {\n\t\t\tif r.Get(i-1) == zero {\n\t\t\t\tinfo = i\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Invert the scale factors.\n\t\tfor i = 1; i <= m; i++ {\n\t\t\tr.Set(i-1, one/math.Min(math.Max(r.Get(i-1), smlnum), bignum))\n\t\t}\n\n\t\t// Compute ROWCND = min(R(I)) / max(R(I))\n\t\trowcnd = math.Max(rcmin, smlnum) / math.Min(rcmax, bignum)\n\t}\n\n\t// Compute column scale factors\n\tfor j = 1; j <= n; j++ {\n\t\tc.Set(j-1, zero)\n\t}\n\n\t// Find the maximum element in each column,\n\t// assuming the row scaling computed above.\n\tfor j = 1; j <= n; j++ {\n\t\tfor i = 1; i <= m; i++ {\n\t\t\tc.Set(j-1, math.Max(c.Get(j-1), cabs1(a.Get(i-1, j-1))*r.Get(i-1)))\n\t\t}\n\t}\n\n\t// Find the maximum and minimum scale factors.\n\trcmin = bignum\n\trcmax = zero\n\tfor j = 1; j <= n; j++ {\n\t\trcmin = math.Min(rcmin, c.Get(j-1))\n\t\trcmax = math.Max(rcmax, c.Get(j-1))\n\t}\n\n\tif rcmin == zero {\n\t\t// Find the first zero scale factor and return an error code.\n\t\tfor j = 1; j <= n; j++ {\n\t\t\tif c.Get(j-1) == zero {\n\t\t\t\tinfo = m + j\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Invert the scale factors.\n\t\tfor j = 1; j <= n; j++ {\n\t\t\tc.Set(j-1, one/math.Min(math.Max(c.Get(j-1), smlnum), bignum))\n\t\t}\n\n\t\t// Compute COLCND = min(C(J)) / max(C(J))\n\t\tcolcnd = math.Max(rcmin, smlnum) / math.Min(rcmax, bignum)\n\t}\n\n\treturn\n}",
"func zchkgg(nsizes int, nn []int, ntypes int, dotype []bool, iseed *[]int, thresh float64, tstdif bool, thrshn float64, a, b, h, t, s1, s2, p1, p2, u, v, q, z *mat.CMatrix, alpha1, beta1, alpha3, beta3 *mat.CVector, evectl, evectr *mat.CMatrix, work *mat.CVector, lwork int, rwork *mat.Vector, llwork []bool, result *mat.Vector) (nerrs, ntestt int, err error) {\n\tvar badnn bool\n\tvar cone, ctemp, czero complex128\n\tvar anorm, bnorm, one, safmax, safmin, temp1, temp2, ulp, ulpinv, zero float64\n\tvar i1, iadd, iinfo, in, j, jc, jr, jsize, jtype, lwkopt, maxtyp, mtypes, n, n1, nmats, nmax, ntest int\n\tlasign := []bool{false, false, false, false, false, false, true, false, true, true, false, false, true, true, true, false, true, false, false, false, true, true, true, true, true, false}\n\tlbsign := []bool{false, false, false, false, false, false, false, true, false, false, true, true, false, false, true, false, true, false, false, false, false, false, false, false, false, false}\n\tcdumma := cvf(4)\n\tdumma := vf(4)\n\trmagn := vf(4)\n\tioldsd := make([]int, 4)\n\tkadd := []int{0, 0, 0, 0, 3, 2}\n\tkamagn := []int{1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 3, 2, 3, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 2, 1}\n\tkatype := []int{0, 1, 0, 1, 2, 3, 4, 1, 4, 4, 1, 1, 4, 4, 4, 2, 4, 5, 8, 7, 9, 4, 4, 4, 4, 0}\n\tkazero := []int{1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 3, 1, 3, 5, 5, 5, 5, 3, 3, 3, 3, 1}\n\tkbmagn := []int{1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 3, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 3, 2, 3, 2, 1}\n\tkbtype := []int{0, 0, 1, 1, 2, -3, 1, 4, 1, 1, 4, 4, 1, 1, -4, 2, -4, 8, 8, 8, 8, 8, 8, 8, 8, 0}\n\tkbzero := []int{1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 4, 1, 4, 6, 6, 6, 6, 4, 4, 4, 4, 1}\n\tkclass := []int{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3}\n\tktrian := []int{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}\n\tkz1 := []int{0, 1, 2, 1, 3, 3}\n\tkz2 := []int{0, 0, 1, 2, 1, 1}\n\n\tzero = 0.0\n\tone = 1.0\n\tczero = (0.0 + 0.0*1i)\n\tcone = (1.0 + 0.0*1i)\n\tmaxtyp = 26\n\n\tbadnn = false\n\tnmax = 1\n\tfor j = 1; j <= nsizes; j++ {\n\t\tnmax = max(nmax, nn[j-1])\n\t\tif nn[j-1] < 0 {\n\t\t\tbadnn = true\n\t\t}\n\t}\n\n\tlwkopt = max(2*nmax*nmax, 4*nmax, 1)\n\n\t// Check for errors\n\tif nsizes < 0 {\n\t\terr = fmt.Errorf(\"nsizes < 0: nsizes=%v\", nsizes)\n\t} else if badnn {\n\t\terr = fmt.Errorf(\"badnn, nn=%v\", nn)\n\t} else if ntypes < 0 {\n\t\terr = fmt.Errorf(\"ntypes < 0: ntypes=%v\", ntypes)\n\t} else if thresh < zero {\n\t\terr = fmt.Errorf(\"thresh < zero: thresh=%v\", thresh)\n\t} else if a.Rows <= 1 || a.Rows < nmax {\n\t\terr = fmt.Errorf(\"a.Rows <= 1 || a.Rows < nmax: a.Rows=%v, nmax=%v\", a.Rows, nmax)\n\t} else if u.Rows <= 1 || u.Rows < nmax {\n\t\terr = fmt.Errorf(\"u.Rows <= 1 || u.Rows < nmax: u.Rows=%v, nmax=%v\", u.Rows, nmax)\n\t} else if lwkopt > lwork {\n\t\terr = fmt.Errorf(\"lwkopt > lwork: lwkopt=%v, lwork=%v\", lwkopt, lwork)\n\t}\n\n\tif err != nil {\n\t\tgltest.Xerbla2(\"zchkgg\", err)\n\t\treturn\n\t}\n\n\t// Quick return if possible\n\tif nsizes == 0 || ntypes == 0 {\n\t\treturn\n\t}\n\n\tsafmin = golapack.Dlamch(SafeMinimum)\n\tulp = golapack.Dlamch(Epsilon) * golapack.Dlamch(Base)\n\tsafmin = safmin / ulp\n\tsafmax = one / safmin\n\tsafmin, safmax = golapack.Dlabad(safmin, safmax)\n\tulpinv = one / ulp\n\n\t// The values RMAGN(2:3) depend on N, see below.\n\trmagn.Set(0, zero)\n\trmagn.Set(1, one)\n\n\t// Loop over sizes, types\n\tntestt = 0\n\tnerrs = 0\n\tnmats = 0\n\n\tfor jsize = 1; jsize <= nsizes; jsize++ {\n\t\tn = nn[jsize-1]\n\t\tn1 = max(1, n)\n\t\trmagn.Set(2, safmax*ulp/float64(n1))\n\t\trmagn.Set(3, safmin*ulpinv*float64(n1))\n\n\t\tif nsizes != 1 {\n\t\t\tmtypes = min(maxtyp, ntypes)\n\t\t} else {\n\t\t\tmtypes = min(maxtyp+1, ntypes)\n\t\t}\n\n\t\tfor jtype = 1; jtype <= mtypes; jtype++ {\n\t\t\tif !dotype[jtype-1] {\n\t\t\t\tgoto label230\n\t\t\t}\n\t\t\tnmats = nmats + 1\n\t\t\tntest = 0\n\n\t\t\t// Save iseed in case of an error.\n\t\t\tfor j = 1; j <= 4; j++ {\n\t\t\t\tioldsd[j-1] = (*iseed)[j-1]\n\t\t\t}\n\n\t\t\t// Initialize RESULT\n\t\t\tfor j = 1; j <= 15; j++ {\n\t\t\t\tresult.Set(j-1, zero)\n\t\t\t}\n\n\t\t\t// Compute A and B\n\t\t\t//\n\t\t\t// Description of control parameters:\n\t\t\t//\n\t\t\t// KZLASS: =1 means w/o rotation, =2 means w/ rotation,\n\t\t\t// =3 means random.\n\t\t\t// KATYPE: the \"_type\" to be passed to ZLATM4 for computing A.\n\t\t\t// KAZERO: the pattern of zeros on the diagonal for A:\n\t\t\t// =1: ( xxx ), =2: (0, xxx ) =3: ( 0, 0, xxx, 0 ),\n\t\t\t// =4: ( 0, xxx, 0, 0 ), =5: ( 0, 0, 1, xxx, 0 ),\n\t\t\t// =6: ( 0, 1, 0, xxx, 0 ). (xxx means a string of\n\t\t\t// non-zero entries.)\n\t\t\t// KAMAGN: the magnitude of the matrix: =0: zero, =1: O(1),\n\t\t\t// =2: large, =3: small.\n\t\t\t// LASIGN: .TRUE. if the diagonal elements of A are to be\n\t\t\t// multiplied by a random magnitude 1 number.\n\t\t\t// KBTYPE, KBZERO, KBMAGN, LBSIGN: the same, but for B.\n\t\t\t// KTRIAN: =0: don't fill in the upper triangle, =1: do.\n\t\t\t// KZ1, KZ2, KADD: used to implement KAZERO and KBZERO.\n\t\t\t// RMAGN: used to implement KAMAGN and KBMAGN.\n\t\t\tif mtypes > maxtyp {\n\t\t\t\tgoto label110\n\t\t\t}\n\t\t\tiinfo = 0\n\t\t\tif kclass[jtype-1] < 3 {\n\t\t\t\t// Generate A (w/o rotation)\n\t\t\t\tif abs(katype[jtype-1]) == 3 {\n\t\t\t\t\tin = 2*((n-1)/2) + 1\n\t\t\t\t\tif in != n {\n\t\t\t\t\t\tgolapack.Zlaset(Full, n, n, czero, czero, a)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tin = n\n\t\t\t\t}\n\t\t\t\tzlatm4(katype[jtype-1], in, kz1[kazero[jtype-1]-1], kz2[kazero[jtype-1]-1], lasign[jtype-1], rmagn.Get(kamagn[jtype-1]-0), ulp, rmagn.Get(ktrian[jtype-1]*kamagn[jtype-1]-0), 4, iseed, a)\n\t\t\t\tiadd = kadd[kazero[jtype-1]-1]\n\t\t\t\tif iadd > 0 && iadd <= n {\n\t\t\t\t\ta.SetRe(iadd-1, iadd-1, rmagn.Get(kamagn[jtype-1]-0))\n\t\t\t\t}\n\t\t\t\t//\n\t\t\t\t// Generate B (w/o rotation)\n\t\t\t\t//\n\t\t\t\tif abs(kbtype[jtype-1]) == 3 {\n\t\t\t\t\tin = 2*((n-1)/2) + 1\n\t\t\t\t\tif in != n {\n\t\t\t\t\t\tgolapack.Zlaset(Full, n, n, czero, czero, b)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tin = n\n\t\t\t\t}\n\t\t\t\tzlatm4(kbtype[jtype-1], in, kz1[kbzero[jtype-1]-1], kz2[kbzero[jtype-1]-1], lbsign[jtype-1], rmagn.Get(kbmagn[jtype-1]-0), one, rmagn.Get(ktrian[jtype-1]*kbmagn[jtype-1]-0), 4, iseed, b)\n\t\t\t\tiadd = kadd[kbzero[jtype-1]-1]\n\t\t\t\tif iadd != 0 {\n\t\t\t\t\tb.SetRe(iadd-1, iadd-1, rmagn.Get(kbmagn[jtype-1]-0))\n\t\t\t\t}\n\n\t\t\t\tif kclass[jtype-1] == 2 && n > 0 {\n\t\t\t\t\t// Include rotations\n\t\t\t\t\t//\n\t\t\t\t\t// Generate U, V as Householder transformations times a\n\t\t\t\t\t// diagonal matrix. (Note that ZLARFG makes U(j,j) and\n\t\t\t\t\t// V(j,j) real.)\n\t\t\t\t\tfor jc = 1; jc <= n-1; jc++ {\n\t\t\t\t\t\tfor jr = jc; jr <= n; jr++ {\n\t\t\t\t\t\t\tu.Set(jr-1, jc-1, matgen.Zlarnd(3, *iseed))\n\t\t\t\t\t\t\tv.Set(jr-1, jc-1, matgen.Zlarnd(3, *iseed))\n\t\t\t\t\t\t}\n\t\t\t\t\t\t*u.GetPtr(jc-1, jc-1), *work.GetPtr(jc - 1) = golapack.Zlarfg(n+1-jc, u.Get(jc-1, jc-1), u.Off(jc, jc-1).CVector(), 1)\n\t\t\t\t\t\twork.SetRe(2*n+jc-1, math.Copysign(one, u.GetRe(jc-1, jc-1)))\n\t\t\t\t\t\tu.Set(jc-1, jc-1, cone)\n\t\t\t\t\t\t*v.GetPtr(jc-1, jc-1), *work.GetPtr(n + jc - 1) = golapack.Zlarfg(n+1-jc, v.Get(jc-1, jc-1), v.Off(jc, jc-1).CVector(), 1)\n\t\t\t\t\t\twork.SetRe(3*n+jc-1, math.Copysign(one, v.GetRe(jc-1, jc-1)))\n\t\t\t\t\t\tv.Set(jc-1, jc-1, cone)\n\t\t\t\t\t}\n\t\t\t\t\tctemp = matgen.Zlarnd(3, *iseed)\n\t\t\t\t\tu.Set(n-1, n-1, cone)\n\t\t\t\t\twork.Set(n-1, czero)\n\t\t\t\t\twork.Set(3*n-1, ctemp/complex(cmplx.Abs(ctemp), 0))\n\t\t\t\t\tctemp = matgen.Zlarnd(3, *iseed)\n\t\t\t\t\tv.Set(n-1, n-1, cone)\n\t\t\t\t\twork.Set(2*n-1, czero)\n\t\t\t\t\twork.Set(4*n-1, ctemp/complex(cmplx.Abs(ctemp), 0))\n\n\t\t\t\t\t// Apply the diagonal matrices\n\t\t\t\t\tfor jc = 1; jc <= n; jc++ {\n\t\t\t\t\t\tfor jr = 1; jr <= n; jr++ {\n\t\t\t\t\t\t\ta.Set(jr-1, jc-1, work.Get(2*n+jr-1)*work.GetConj(3*n+jc-1)*a.Get(jr-1, jc-1))\n\t\t\t\t\t\t\tb.Set(jr-1, jc-1, work.Get(2*n+jr-1)*work.GetConj(3*n+jc-1)*b.Get(jr-1, jc-1))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif err = golapack.Zunm2r(Left, NoTrans, n, n, n-1, u, work, a, work.Off(2*n)); err != nil {\n\t\t\t\t\t\tgoto label100\n\t\t\t\t\t}\n\t\t\t\t\tif err = golapack.Zunm2r(Right, ConjTrans, n, n, n-1, v, work.Off(n), a, work.Off(2*n)); err != nil {\n\t\t\t\t\t\tgoto label100\n\t\t\t\t\t}\n\t\t\t\t\tif err = golapack.Zunm2r(Left, NoTrans, n, n, n-1, u, work, b, work.Off(2*n)); err != nil {\n\t\t\t\t\t\tgoto label100\n\t\t\t\t\t}\n\t\t\t\t\tif err = golapack.Zunm2r(Right, ConjTrans, n, n, n-1, v, work.Off(n), b, work.Off(2*n)); err != nil {\n\t\t\t\t\t\tgoto label100\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Random matrices\n\t\t\t\tfor jc = 1; jc <= n; jc++ {\n\t\t\t\t\tfor jr = 1; jr <= n; jr++ {\n\t\t\t\t\t\ta.Set(jr-1, jc-1, rmagn.GetCmplx(kamagn[jtype-1]-0)*matgen.Zlarnd(4, *iseed))\n\t\t\t\t\t\tb.Set(jr-1, jc-1, rmagn.GetCmplx(kbmagn[jtype-1]-0)*matgen.Zlarnd(4, *iseed))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tanorm = golapack.Zlange('1', n, n, a, rwork)\n\t\t\tbnorm = golapack.Zlange('1', n, n, b, rwork)\n\n\t\tlabel100:\n\t\t\t;\n\n\t\t\tif iinfo != 0 {\n\t\t\t\tfmt.Printf(\" zchkgg: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Generator\", iinfo, n, jtype, ioldsd)\n\t\t\t\terr = fmt.Errorf(\"iinfo=%v\", abs(iinfo))\n\t\t\t\treturn\n\t\t\t}\n\n\t\tlabel110:\n\t\t\t;\n\n\t\t\t// Call Zgeqr2, Zunm2r, and Zgghrd to compute H, T, U, and V\n\t\t\tgolapack.Zlacpy(Full, n, n, a, h)\n\t\t\tgolapack.Zlacpy(Full, n, n, b, t)\n\t\t\tntest = 1\n\t\t\tresult.Set(0, ulpinv)\n\n\t\t\tif err = golapack.Zgeqr2(n, n, t, work, work.Off(n)); err != nil {\n\t\t\t\tfmt.Printf(\" zchkgg: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Zgeqr2\", iinfo, n, jtype, ioldsd)\n\t\t\t\tgoto label210\n\t\t\t}\n\n\t\t\tif err = golapack.Zunm2r(Left, ConjTrans, n, n, n, t, work, h, work.Off(n)); err != nil {\n\t\t\t\tfmt.Printf(\" zchkgg: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Zunm2r\", iinfo, n, jtype, ioldsd)\n\t\t\t\tgoto label210\n\t\t\t}\n\n\t\t\tgolapack.Zlaset(Full, n, n, czero, cone, u)\n\t\t\tif err = golapack.Zunm2r(Right, NoTrans, n, n, n, t, work, u, work.Off(n)); err != nil {\n\t\t\t\tfmt.Printf(\" zchkgg: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Zunm2r\", iinfo, n, jtype, ioldsd)\n\t\t\t\tgoto label210\n\t\t\t}\n\n\t\t\tif err = golapack.Zgghrd('V', 'I', n, 1, n, h, t, u, v); err != nil {\n\t\t\t\tfmt.Printf(\" zchkgg: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Zgghrd\", iinfo, n, jtype, ioldsd)\n\t\t\t\tgoto label210\n\t\t\t}\n\t\t\tntest = 4\n\n\t\t\t// Do tests 1--4\n\t\t\tresult.Set(0, zget51(1, n, a, h, u, v, work, rwork))\n\t\t\tresult.Set(1, zget51(1, n, b, t, u, v, work, rwork))\n\t\t\tresult.Set(2, zget51(3, n, b, t, u, u, work, rwork))\n\t\t\tresult.Set(3, zget51(3, n, b, t, v, v, work, rwork))\n\n\t\t\t// Call Zhgeqz to compute S1, P1, S2, P2, Q, and Z, do tests.\n\t\t\t//\n\t\t\t// Compute T1 and UZ\n\t\t\t//\n\t\t\t// Eigenvalues only\n\t\t\tgolapack.Zlacpy(Full, n, n, h, s2)\n\t\t\tgolapack.Zlacpy(Full, n, n, t, p2)\n\t\t\tntest = 5\n\t\t\tresult.Set(4, ulpinv)\n\n\t\t\tif iinfo, err = golapack.Zhgeqz('E', 'N', 'N', n, 1, n, s2, p2, alpha3, beta3, q, z, work, lwork, rwork); err != nil || iinfo != 0 {\n\t\t\t\tfmt.Printf(\" zchkgg: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Zhgeqz(E)\", iinfo, n, jtype, ioldsd)\n\t\t\t\tgoto label210\n\t\t\t}\n\n\t\t\t// Eigenvalues and Full Schur Form\n\t\t\tgolapack.Zlacpy(Full, n, n, h, s2)\n\t\t\tgolapack.Zlacpy(Full, n, n, t, p2)\n\n\t\t\tif iinfo, err = golapack.Zhgeqz('S', 'N', 'N', n, 1, n, s2, p2, alpha1, beta1, q, z, work, lwork, rwork); err != nil || iinfo != 0 {\n\t\t\t\tfmt.Printf(\" zchkgg: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Zhgeqz(S)\", iinfo, n, jtype, ioldsd)\n\t\t\t\tgoto label210\n\t\t\t}\n\n\t\t\t// Eigenvalues, Schur Form, and Schur Vectors\n\t\t\tgolapack.Zlacpy(Full, n, n, h, s1)\n\t\t\tgolapack.Zlacpy(Full, n, n, t, p1)\n\n\t\t\tif iinfo, err = golapack.Zhgeqz('S', 'I', 'I', n, 1, n, s1, p1, alpha1, beta1, q, z, work, lwork, rwork); err != nil || iinfo != 0 {\n\t\t\t\tfmt.Printf(\" zchkgg: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Zhgeqz(V)\", iinfo, n, jtype, ioldsd)\n\t\t\t\tgoto label210\n\t\t\t}\n\n\t\t\tntest = 8\n\n\t\t\t// Do Tests 5--8\n\t\t\tresult.Set(4, zget51(1, n, h, s1, q, z, work, rwork))\n\t\t\tresult.Set(5, zget51(1, n, t, p1, q, z, work, rwork))\n\t\t\tresult.Set(6, zget51(3, n, t, p1, q, q, work, rwork))\n\t\t\tresult.Set(7, zget51(3, n, t, p1, z, z, work, rwork))\n\n\t\t\t// Compute the Left and Right Eigenvectors of (S1,P1)\n\t\t\t//\n\t\t\t// 9: Compute the left eigenvector Matrix without\n\t\t\t// back transforming:\n\t\t\tntest = 9\n\t\t\tresult.Set(8, ulpinv)\n\n\t\t\t// To test \"SELECT\" option, compute half of the eigenvectors\n\t\t\t// in one call, and half in another\n\t\t\ti1 = n / 2\n\t\t\tfor j = 1; j <= i1; j++ {\n\t\t\t\tllwork[j-1] = true\n\t\t\t}\n\t\t\tfor j = i1 + 1; j <= n; j++ {\n\t\t\t\tllwork[j-1] = false\n\t\t\t}\n\n\t\t\tif in, err = golapack.Ztgevc(Left, 'S', llwork, n, s1, p1, evectl, cdumma.CMatrix(u.Rows, opts), n, work, rwork); err != nil {\n\t\t\t\tfmt.Printf(\" zchkgg: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Ztgevc(L,S1)\", iinfo, n, jtype, ioldsd)\n\t\t\t\tgoto label210\n\t\t\t}\n\n\t\t\ti1 = in\n\t\t\tfor j = 1; j <= i1; j++ {\n\t\t\t\tllwork[j-1] = false\n\t\t\t}\n\t\t\tfor j = i1 + 1; j <= n; j++ {\n\t\t\t\tllwork[j-1] = true\n\t\t\t}\n\n\t\t\tif in, err = golapack.Ztgevc(Left, 'S', llwork, n, s1, p1, evectl.Off(0, i1), cdumma.CMatrix(u.Rows, opts), n, work, rwork); err != nil {\n\t\t\t\tfmt.Printf(\" zchkgg: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Ztgevc(L,S2)\", iinfo, n, jtype, ioldsd)\n\t\t\t\tgoto label210\n\t\t\t}\n\n\t\t\tzget52(true, n, s1, p1, evectl, alpha1, beta1, work, rwork, dumma.Off(0))\n\t\t\tresult.Set(8, dumma.Get(0))\n\t\t\tif dumma.Get(1) > thrshn {\n\t\t\t\tfmt.Printf(\" zchkgg: %s Eigenvectors from %s incorrectly normalized.\\n Bits of error=%10.3f, n=%6d, jtype=%6d, iseed=%5d\\n\", \"Left\", \"Ztgevc(HOWMNY=S)\", dumma.Get(1), n, jtype, ioldsd)\n\t\t\t\terr = fmt.Errorf(\" zchkgg: %s Eigenvectors from %s incorrectly normalized.\\n Bits of error=%10.3f, n=%6d, jtype=%6d, iseed=%5d\\n\", \"Left\", \"Ztgevc(HOWMNY=S)\", dumma.Get(1), n, jtype, ioldsd)\n\t\t\t}\n\n\t\t\t// 10: Compute the left eigenvector Matrix with\n\t\t\t// back transforming:\n\t\t\tntest = 10\n\t\t\tresult.Set(9, ulpinv)\n\t\t\tgolapack.Zlacpy(Full, n, n, q, evectl)\n\t\t\tif in, err = golapack.Ztgevc(Left, 'B', llwork, n, s1, p1, evectl, cdumma.CMatrix(u.Rows, opts), n, work, rwork); err != nil {\n\t\t\t\tfmt.Printf(\" zchkgg: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Ztgevc(L,B)\", iinfo, n, jtype, ioldsd)\n\t\t\t\tgoto label210\n\t\t\t}\n\n\t\t\tzget52(true, n, h, t, evectl, alpha1, beta1, work, rwork, dumma.Off(0))\n\t\t\tresult.Set(9, dumma.Get(0))\n\t\t\tif dumma.Get(1) > thrshn {\n\t\t\t\tfmt.Printf(\" zchkgg: %s Eigenvectors from %s incorrectly normalized.\\n Bits of error=%10.3f, n=%6d, jtype=%6d, iseed=%5d\\n\", \"Left\", \"Ztgevc(HOWMNY=B)\", dumma.Get(1), n, jtype, ioldsd)\n\t\t\t\terr = fmt.Errorf(\" zchkgg: %s Eigenvectors from %s incorrectly normalized.\\n Bits of error=%10.3f, n=%6d, jtype=%6d, iseed=%5d\\n\", \"Left\", \"Ztgevc(HOWMNY=B)\", dumma.Get(1), n, jtype, ioldsd)\n\t\t\t}\n\n\t\t\t// 11: Compute the right eigenvector Matrix without\n\t\t\t// back transforming:\n\t\t\tntest = 11\n\t\t\tresult.Set(10, ulpinv)\n\n\t\t\t// To test \"SELECT\" option, compute half of the eigenvectors\n\t\t\t// in one call, and half in another\n\t\t\ti1 = n / 2\n\t\t\tfor j = 1; j <= i1; j++ {\n\t\t\t\tllwork[j-1] = true\n\t\t\t}\n\t\t\tfor j = i1 + 1; j <= n; j++ {\n\t\t\t\tllwork[j-1] = false\n\t\t\t}\n\n\t\t\tif in, err = golapack.Ztgevc(Right, 'S', llwork, n, s1, p1, cdumma.CMatrix(u.Rows, opts), evectr, n, work, rwork); err != nil {\n\t\t\t\tfmt.Printf(\" zchkgg: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Ztgevc(R,S1)\", iinfo, n, jtype, ioldsd)\n\t\t\t\tgoto label210\n\t\t\t}\n\n\t\t\ti1 = in\n\t\t\tfor j = 1; j <= i1; j++ {\n\t\t\t\tllwork[j-1] = false\n\t\t\t}\n\t\t\tfor j = i1 + 1; j <= n; j++ {\n\t\t\t\tllwork[j-1] = true\n\t\t\t}\n\n\t\t\tif in, err = golapack.Ztgevc(Right, 'S', llwork, n, s1, p1, cdumma.CMatrix(u.Rows, opts), evectr.Off(0, i1), n, work, rwork); err != nil {\n\t\t\t\tfmt.Printf(\" zchkgg: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Ztgevc(R,S2)\", iinfo, n, jtype, ioldsd)\n\t\t\t\tgoto label210\n\t\t\t}\n\n\t\t\tzget52(false, n, s1, p1, evectr, alpha1, beta1, work, rwork, dumma.Off(0))\n\t\t\tresult.Set(10, dumma.Get(0))\n\t\t\tif dumma.Get(1) > thresh {\n\t\t\t\tfmt.Printf(\" zchkgg: %s Eigenvectors from %s incorrectly normalized.\\n Bits of error=%10.3f, n=%6d, jtype=%6d, iseed=%5d\\n\", \"Right\", \"Ztgevc(HOWMNY=S)\", dumma.Get(1), n, jtype, ioldsd)\n\t\t\t\terr = fmt.Errorf(\" zchkgg: %s Eigenvectors from %s incorrectly normalized.\\n Bits of error=%10.3f, n=%6d, jtype=%6d, iseed=%5d\\n\", \"Right\", \"Ztgevc(HOWMNY=S)\", dumma.Get(1), n, jtype, ioldsd)\n\t\t\t}\n\n\t\t\t// 12: Compute the right eigenvector Matrix with\n\t\t\t// back transforming:\n\t\t\tntest = 12\n\t\t\tresult.Set(11, ulpinv)\n\t\t\tgolapack.Zlacpy(Full, n, n, z, evectr)\n\t\t\tif in, err = golapack.Ztgevc(Right, 'B', llwork, n, s1, p1, cdumma.CMatrix(u.Rows, opts), evectr, n, work, rwork); err != nil {\n\t\t\t\tfmt.Printf(\" zchkgg: %s returned info=%6d.\\n n=%6d, jtype=%6d, iseed=%5d\\n\", \"Ztgevc(R,B)\", iinfo, n, jtype, ioldsd)\n\t\t\t\tgoto label210\n\t\t\t}\n\n\t\t\tzget52(false, n, h, t, evectr, alpha1, beta1, work, rwork, dumma.Off(0))\n\t\t\tresult.Set(11, dumma.Get(0))\n\t\t\tif dumma.Get(1) > thresh {\n\t\t\t\tfmt.Printf(\" zchkgg: %s Eigenvectors from %s incorrectly normalized.\\n Bits of error=%10.3f, n=%6d, jtype=%6d, iseed=%5d\\n\", \"Right\", \"Ztgevc(HOWMNY=B)\", dumma.Get(1), n, jtype, ioldsd)\n\t\t\t\terr = fmt.Errorf(\" zchkgg: %s Eigenvectors from %s incorrectly normalized.\\n Bits of error=%10.3f, n=%6d, jtype=%6d, iseed=%5d\\n\", \"Right\", \"Ztgevc(HOWMNY=B)\", dumma.Get(1), n, jtype, ioldsd)\n\t\t\t}\n\n\t\t\t// Tests 13--15 are done only on request\n\t\t\tif tstdif {\n\t\t\t\t// Do Tests 13--14\n\t\t\t\tresult.Set(12, zget51(2, n, s1, s2, q, z, work, rwork))\n\t\t\t\tresult.Set(13, zget51(2, n, p1, p2, q, z, work, rwork))\n\n\t\t\t\t// Do Test 15\n\t\t\t\ttemp1 = zero\n\t\t\t\ttemp2 = zero\n\t\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\t\ttemp1 = math.Max(temp1, cmplx.Abs(alpha1.Get(j-1)-alpha3.Get(j-1)))\n\t\t\t\t\ttemp2 = math.Max(temp2, cmplx.Abs(beta1.Get(j-1)-beta3.Get(j-1)))\n\t\t\t\t}\n\n\t\t\t\ttemp1 = temp1 / math.Max(safmin, ulp*math.Max(temp1, anorm))\n\t\t\t\ttemp2 = temp2 / math.Max(safmin, ulp*math.Max(temp2, bnorm))\n\t\t\t\tresult.Set(14, math.Max(temp1, temp2))\n\t\t\t\tntest = 15\n\t\t\t} else {\n\t\t\t\tresult.Set(12, zero)\n\t\t\t\tresult.Set(13, zero)\n\t\t\t\tresult.Set(14, zero)\n\t\t\t\tntest = 12\n\t\t\t}\n\n\t\t\t// End of Loop -- Check for RESULT(j) > THRESH\n\t\tlabel210:\n\t\t\t;\n\n\t\t\tntestt = ntestt + ntest\n\n\t\t\t// Print out tests which fail.\n\t\t\tfor jr = 1; jr <= ntest; jr++ {\n\t\t\t\tif result.Get(jr-1) >= thresh {\n\t\t\t\t\t// If this is the first test to fail,\n\t\t\t\t\t// print a header to the data file.\n\t\t\t\t\tif nerrs == 0 {\n\t\t\t\t\t\tfmt.Printf(\" %3s -- Complex Generalized eigenvalue problem\\n\", \"ZGG\")\n\n\t\t\t\t\t\t// Matrix types\n\t\t\t\t\t\tfmt.Printf(\" Matrix types (see zchkgg for details): \\n\")\n\t\t\t\t\t\tfmt.Printf(\" Special Matrices: (J'=transposed Jordan block)\\n 1=(0,0) 2=(I,0) 3=(0,I) 4=(I,I) 5=(J',J') 6=(diag(J',I), diag(I,J'))\\n Diagonal Matrices: ( D=diag(0,1,2,...) )\\n 7=(D,I) 9=(large*D, small*I) 11=(large*I, small*D) 13=(large*D, large*I)\\n 8=(I,D) 10=(small*D, large*I) 12=(small*I, large*D) 14=(small*D, small*I)\\n 15=(D, reversed D)\\n\")\n\t\t\t\t\t\tfmt.Printf(\" Matrices Rotated by Random %s Matrices U, V:\\n 16=Transposed Jordan Blocks 19=geometric alpha, beta=0,1\\n 17=arithm. alpha&beta 20=arithmetic alpha, beta=0,1\\n 18=clustered alpha, beta=0,1 21=random alpha, beta=0,1\\n Large & Small Matrices:\\n 22=(large, small) 23=(small,large) 24=(small,small) 25=(large,large)\\n 26=random O(1) matrices.\\n\", \"Unitary\")\n\n\t\t\t\t\t\t// Tests performed\n\t\t\t\t\t\tfmt.Printf(\"\\n Tests performed: (H is Hessenberg, S is Schur, B, T, P are triangular,\\n U, V, Q, and Z are %s, l and r are the\\n appropriate left and right eigenvectors, resp., a is\\n alpha, b is beta, and %s means %s.)\\n 1 = | A - U H V%s | / ( |A| n ulp ) 2 = | B - U T V%s | / ( |B| n ulp )\\n 3 = | I - UU%s | / ( n ulp ) 4 = | I - VV%s | / ( n ulp )\\n 5 = | H - Q S Z%s | / ( |H| n ulp ) 6 = | T - Q P Z%s | / ( |T| n ulp )\\n 7 = | I - QQ%s | / ( n ulp ) 8 = | I - ZZ%s | / ( n ulp )\\n 9 = max | ( b S - a P )%s l | / const. 10 = max | ( b H - a T )%s l | / const.\\n 11= max | ( b S - a P ) r | / const. 12 = max | ( b H - a T ) r | / const.\\n \\n\", \"unitary\", \"*\", \"conjugate transpose\", \"*\", \"*\", \"*\", \"*\", \"*\", \"*\", \"*\", \"*\", \"*\", \"*\")\n\n\t\t\t\t\t}\n\t\t\t\t\tnerrs = nerrs + 1\n\t\t\t\t\tif result.Get(jr-1) < 10000.0 {\n\t\t\t\t\t\tfmt.Printf(\" Matrix order=%5d, _type=%2d, seed=%4d, result %2d is%8.2f\\n\", n, jtype, ioldsd, jr, result.Get(jr-1))\n\t\t\t\t\t\terr = fmt.Errorf(\" Matrix order=%5d, _type=%2d, seed=%4d, result %2d is%8.2f\\n\", n, jtype, ioldsd, jr, result.Get(jr-1))\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Printf(\" Matrix order=%5d, _type=%2d, seed=%4d, result %2d is%10.3E\\n\", n, jtype, ioldsd, jr, result.Get(jr-1))\n\t\t\t\t\t\terr = fmt.Errorf(\" Matrix order=%5d, _type=%2d, seed=%4d, result %2d is%10.3E\\n\", n, jtype, ioldsd, jr, result.Get(jr-1))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\tlabel230:\n\t\t}\n\t}\n\n\t// Summary\n\t// dlasum(\"Zgg\", nerrs, ntestt)\n\n\treturn\n}",
"func (mutant *mutant) runDiagonalInvSearch() {\n\n\tn := len(mutant.Adn)\n\tfor i := 0; i < n-SIZE_SUBSEQUENCE+1; i++ { // horizontal / vertical movs\n\n\t\tif mutant.counter >= MAX_SUBSEQUENCES {\n\t\t\treturn\n\t\t}\n\t\twg := sync.WaitGroup{}\n\t\twg.Add(2)\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\tfor j := 0; j < n-SIZE_SUBSEQUENCE+1; { // horizontal movs\n\t\t\t\tif mutant.counter >= MAX_SUBSEQUENCES {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tk := n - j - 1\n\t\t\t\tseq := mutant.getDiagonalInvFrom(i, k)\n\t\t\t\tlastIndex := mutant.verifySequence(seq)\n\t\t\t\tj += 1 + lastIndex\n\n\t\t\t}\n\t\t}()\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\n\t\t\tfor j := 0; j < n-SIZE_SUBSEQUENCE; { // vertical movs\n\t\t\t\tif mutant.counter >= MAX_SUBSEQUENCES {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tk := n - i - 1\n\n\t\t\t\tseq := mutant.getDiagonalInvFrom(j+1, k)\n\t\t\t\tlastIndex := mutant.verifySequence(seq)\n\t\t\t\tj += 1 + lastIndex\n\n\t\t\t}\n\t\t}()\n\t\twg.Wait()\n\n\t}\n}",
"func ECDH_ECPSVDP_DH(S []byte, WD []byte, Z []byte,typ int) int {\n\tres := 0\n\n\ts := FromBytes(S)\n\n\tW := ECP_fromBytes(WD)\n\tif W.Is_infinity() {\n\t\tres = ERROR\n\t}\n\n\tif res == 0 {\n\t\tr := NewBIGints(CURVE_Order)\n\t\ts.Mod(r)\n\t\tW = W.mul(s)\n\t\tif W.Is_infinity() {\n\t\t\tres = ERROR\n\t\t} else {\n\t\t\tif CURVETYPE != MONTGOMERY {\n\t\t\t\tif typ>0 {\n\t\t\t\t\tif typ==1 {\n\t\t\t\t\t\tW.ToBytes(Z,true)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tW.ToBytes(Z,false)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tW.GetX().ToBytes(Z)\n\t\t\t\t}\n\t\t\t\treturn res;\n\t\t\t} else {\n\t\t\t\tW.GetX().ToBytes(Z)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}",
"func VGETEXPSD_SAE_Z(x, x1, k, x2 operand.Op) { ctx.VGETEXPSD_SAE_Z(x, x1, k, x2) }",
"func dsytrs(uplo Triangle, n, nrhs int, a []float64, lda int, ipiv []int, b []float64, ldb int) error {\n\treturn dsytrsHelper(uplo, n, nrhs, a, lda, toCInt(ipiv), b, ldb)\n}",
"func Ztptrs(uplo mat.MatUplo, trans mat.MatTrans, diag mat.MatDiag, n, nrhs int, ap *mat.CVector, b *mat.CMatrix) (info int, err error) {\n\tvar nounit, upper bool\n\tvar zero complex128\n\tvar j, jc int\n\n\tzero = (0.0 + 0.0*1i)\n\n\t// Test the input parameters.\n\tupper = uplo == Upper\n\tnounit = diag == NonUnit\n\tif !upper && uplo != Lower {\n\t\terr = fmt.Errorf(\"!upper && uplo != Lower: uplo=%s\", uplo)\n\t} else if trans != NoTrans && trans != Trans && trans != ConjTrans {\n\t\terr = fmt.Errorf(\"trans != NoTrans && trans != Trans && trans != ConjTrans: trans=%s\", trans)\n\t} else if !nounit && diag != Unit {\n\t\terr = fmt.Errorf(\"!nounit && diag != Unit: diag=%s\", diag)\n\t} else if n < 0 {\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if nrhs < 0 {\n\t\terr = fmt.Errorf(\"nrhs < 0: nrhs=%v\", nrhs)\n\t} else if b.Rows < max(1, n) {\n\t\terr = fmt.Errorf(\"b.Rows < max(1, n): b.Rows=%v, n=%v\", b.Rows, n)\n\t}\n\tif err != nil {\n\t\tgltest.Xerbla2(\"Ztptrs\", err)\n\t\treturn\n\t}\n\n\t// Quick return if possible\n\tif n == 0 {\n\t\treturn\n\t}\n\n\t// Check for singularity.\n\tif nounit {\n\t\tif upper {\n\t\t\tjc = 1\n\t\t\tfor info = 1; info <= n; info++ {\n\t\t\t\tif ap.Get(jc+info-1-1) == zero {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tjc = jc + info\n\t\t\t}\n\t\t} else {\n\t\t\tjc = 1\n\t\t\tfor info = 1; info <= n; info++ {\n\t\t\t\tif ap.Get(jc-1) == zero {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tjc = jc + n - info + 1\n\t\t\t}\n\t\t}\n\t}\n\tinfo = 0\n\n\t// Solve A * x = b, A**T * x = b, or A**H * x = b.\n\tfor j = 1; j <= nrhs; j++ {\n\t\tif err = b.Off(0, j-1).CVector().Tpsv(uplo, trans, diag, n, ap, 1); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\n\treturn\n}",
"func Dfct(n int, a []float64, t []float64, ip []int, w []float64) {\n\tvar j, k, l, m, mh, nw, nc int\n\tvar xr, xi, yr, yi float64\n\n\tnw = ip[0]\n\tif n > (nw << 3) {\n\t\tnw = n >> 3\n\t\tmakewt(nw, ip, w)\n\t}\n\tnc = ip[1]\n\tif n > (nc << 1) {\n\t\tnc = n >> 1\n\t\tmakect(nc, ip, w[nw:])\n\t}\n\tm = n >> 1\n\tyi = a[m]\n\txi = a[0] + a[n]\n\ta[0] -= a[n]\n\tt[0] = xi - yi\n\tt[m] = xi + yi\n\tif n > 2 {\n\t\tmh = m >> 1\n\t\tfor j = 1; j < mh; j++ {\n\t\t\tk = m - j\n\t\t\txr = a[j] - a[n-j]\n\t\t\txi = a[j] + a[n-j]\n\t\t\tyr = a[k] - a[n-k]\n\t\t\tyi = a[k] + a[n-k]\n\t\t\ta[j] = xr\n\t\t\ta[k] = yr\n\t\t\tt[j] = xi - yi\n\t\t\tt[k] = xi + yi\n\t\t}\n\t\tt[mh] = a[mh] + a[n-mh]\n\t\ta[mh] -= a[n-mh]\n\t\tdctsub(m, a, nc, w[nw:])\n\t\tif m > 4 {\n\t\t\tcftfsub(m, a, ip, nw, w)\n\t\t\trftfsub(m, a, nc, w[nw:])\n\t\t} else if m == 4 {\n\t\t\tcftfsub(m, a, ip, nw, w)\n\t\t}\n\t\ta[n-1] = a[0] - a[1]\n\t\ta[1] = a[0] + a[1]\n\t\tfor j = m - 2; j >= 2; j -= 2 {\n\t\t\ta[2*j+1] = a[j] + a[j+1]\n\t\t\ta[2*j-1] = a[j] - a[j+1]\n\t\t}\n\t\tl = 2\n\t\tm = mh\n\t\tfor m >= 2 {\n\t\t\tdctsub(m, t, nc, w[nw:])\n\t\t\tif m > 4 {\n\t\t\t\tcftfsub(m, t, ip, nw, w)\n\t\t\t\trftfsub(m, t, nc, w[nw:])\n\t\t\t} else if m == 4 {\n\t\t\t\tcftfsub(m, t, ip, nw, w)\n\t\t\t}\n\t\t\ta[n-l] = t[0] - t[1]\n\t\t\ta[l] = t[0] + t[1]\n\t\t\tk = 0\n\t\t\tfor j = 2; j < m; j += 2 {\n\t\t\t\tk += l << 2\n\t\t\t\ta[k-l] = t[j] - t[j+1]\n\t\t\t\ta[k+l] = t[j] + t[j+1]\n\t\t\t}\n\t\t\tl <<= 1\n\t\t\tmh = m >> 1\n\t\t\tfor j = 0; j < mh; j++ {\n\t\t\t\tk = m - j\n\t\t\t\tt[j] = t[m+k] - t[m+j]\n\t\t\t\tt[k] = t[m+k] + t[m+j]\n\t\t\t}\n\t\t\tt[mh] = t[m+mh]\n\t\t\tm = mh\n\t\t}\n\t\ta[l] = t[0]\n\t\ta[n] = t[2] - t[1]\n\t\ta[0] = t[2] + t[1]\n\t} else {\n\t\ta[1] = a[0]\n\t\ta[2] = t[0]\n\t\ta[0] = t[1]\n\t}\n}",
"func dgsvts3(m, p, n int, a, af, b, bf, u, v, q *mat.Matrix, alpha, beta *mat.Vector, r *mat.Matrix, iwork *[]int, work *mat.Vector, lwork int, rwork, result *mat.Vector) {\n\tvar anorm, bnorm, one, resid, temp, ulp, ulpinv, unfl, zero float64\n\tvar i, j, k, l int\n\tvar err error\n\n\tzero = 0.0\n\tone = 1.0\n\n\tulp = golapack.Dlamch(Precision)\n\tulpinv = one / ulp\n\tunfl = golapack.Dlamch(SafeMinimum)\n\n\t// Copy the matrix A to the array AF.\n\tgolapack.Dlacpy(Full, m, n, a, af)\n\tgolapack.Dlacpy(Full, p, n, b, bf)\n\n\tanorm = math.Max(golapack.Dlange('1', m, n, a, rwork), unfl)\n\tbnorm = math.Max(golapack.Dlange('1', p, n, b, rwork), unfl)\n\n\t// Factorize the matrices A and B in the arrays AF and BF.\n\tif k, l, _, err = golapack.Dggsvd3('U', 'V', 'Q', m, n, p, af, bf, alpha, beta, u, v, q, work, lwork, iwork); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Copy R\n\tfor i = 1; i <= min(k+l, m); i++ {\n\t\tfor j = i; j <= k+l; j++ {\n\t\t\tr.Set(i-1, j-1, af.Get(i-1, n-k-l+j-1))\n\t\t}\n\t}\n\n\tif m-k-l < 0 {\n\t\tfor i = m + 1; i <= k+l; i++ {\n\t\t\tfor j = i; j <= k+l; j++ {\n\t\t\t\tr.Set(i-1, j-1, bf.Get(i-k-1, n-k-l+j-1))\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compute A:= U'*A*Q - D1*R\n\tif err = work.Matrix(a.Rows, opts).Gemm(NoTrans, NoTrans, m, n, n, one, a, q, zero); err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err = a.Gemm(Trans, NoTrans, m, n, m, one, u, work.Matrix(a.Rows, opts), zero); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor i = 1; i <= k; i++ {\n\t\tfor j = i; j <= k+l; j++ {\n\t\t\ta.Set(i-1, n-k-l+j-1, a.Get(i-1, n-k-l+j-1)-r.Get(i-1, j-1))\n\t\t}\n\t}\n\n\tfor i = k + 1; i <= min(k+l, m); i++ {\n\t\tfor j = i; j <= k+l; j++ {\n\t\t\ta.Set(i-1, n-k-l+j-1, a.Get(i-1, n-k-l+j-1)-alpha.Get(i-1)*r.Get(i-1, j-1))\n\t\t}\n\t}\n\n\t// Compute norm( U'*A*Q - D1*R ) / ( max(1,M,N)*norm(A)*ULP ) .\n\tresid = golapack.Dlange('1', m, n, a, rwork)\n\n\tif anorm > zero {\n\t\tresult.Set(0, ((resid/float64(max(1, m, n)))/anorm)/ulp)\n\t} else {\n\t\tresult.Set(0, zero)\n\t}\n\n\t// Compute B := V'*B*Q - D2*R\n\tif err = work.Matrix(b.Rows, opts).Gemm(NoTrans, NoTrans, p, n, n, one, b, q, zero); err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err = b.Gemm(Trans, NoTrans, p, n, p, one, v, work.Matrix(a.Rows, opts), zero); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor i = 1; i <= l; i++ {\n\t\tfor j = i; j <= l; j++ {\n\t\t\tb.Set(i-1, n-l+j-1, b.Get(i-1, n-l+j-1)-beta.Get(k+i-1)*r.Get(k+i-1, k+j-1))\n\t\t}\n\t}\n\n\t// Compute norm( V'*B*Q - D2*R ) / ( max(P,N)*norm(B)*ULP ) .\n\tresid = golapack.Dlange('1', p, n, b, rwork)\n\tif bnorm > zero {\n\t\tresult.Set(1, ((resid/float64(max(1, p, n)))/bnorm)/ulp)\n\t} else {\n\t\tresult.Set(1, zero)\n\t}\n\n\t// Compute I - U'*U\n\tgolapack.Dlaset(Full, m, m, zero, one, work.Matrix(q.Rows, opts))\n\tif err = work.Matrix(u.Rows, opts).Syrk(Upper, Trans, m, m, -one, u, one); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Compute norm( I - U'*U ) / ( M * ULP ) .\n\tresid = golapack.Dlansy('1', Upper, m, work.Matrix(u.Rows, opts), rwork)\n\tresult.Set(2, (resid/float64(max(1, m)))/ulp)\n\n\t// Compute I - V'*V\n\tgolapack.Dlaset(Full, p, p, zero, one, work.Matrix(v.Rows, opts))\n\tif err = work.Matrix(v.Rows, opts).Syrk(Upper, Trans, p, p, -one, v, one); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Compute norm( I - V'*V ) / ( P * ULP ) .\n\tresid = golapack.Dlansy('1', Upper, p, work.Matrix(v.Rows, opts), rwork)\n\tresult.Set(3, (resid/float64(max(1, p)))/ulp)\n\n\t// Compute I - Q'*Q\n\tgolapack.Dlaset(Full, n, n, zero, one, work.Matrix(q.Rows, opts))\n\tif err = work.Matrix(q.Rows, opts).Syrk(Upper, Trans, n, n, -one, q, one); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Compute norm( I - Q'*Q ) / ( N * ULP ) .\n\tresid = golapack.Dlansy('1', Upper, n, work.Matrix(q.Rows, opts), rwork)\n\tresult.Set(4, (resid/float64(max(1, n)))/ulp)\n\n\t// Check sorting\n\twork.Copy(n, alpha, 1, 1)\n\tfor i = k + 1; i <= min(k+l, m); i++ {\n\t\tj = (*iwork)[i-1]\n\t\tif i != j {\n\t\t\ttemp = work.Get(i - 1)\n\t\t\twork.Set(i-1, work.Get(j-1))\n\t\t\twork.Set(j-1, temp)\n\t\t}\n\t}\n\n\tresult.Set(5, zero)\n\tfor i = k + 1; i <= min(k+l, m)-1; i++ {\n\t\tif work.Get(i-1) < work.Get(i) {\n\t\t\tresult.Set(5, ulpinv)\n\t\t}\n\t}\n\n\treturn\n}",
"func CalcASERTDiff(startDiffBits uint32, powLimit *big.Int, targetSecsPerBlock,\n\ttimeDelta, heightDelta, halfLife int64) uint32 {\n\n\t// Ensure parameter assumptions are not violated.\n\t//\n\t// 1. The starting target difficulty must be in the range [1, powLimit]\n\t// 2. The height to calculate the difficulty for must come after the height\n\t// of the reference block\n\tstartDiff := CompactToBig(startDiffBits)\n\tif startDiff.Sign() <= 0 || startDiff.Cmp(powLimit) > 0 {\n\t\tpanicf(\"starting difficulty %064x is not in the valid range [1, %064x]\",\n\t\t\tstartDiff, powLimit)\n\t}\n\tif heightDelta < 0 {\n\t\tpanicf(\"provided height delta %d is negative\", heightDelta)\n\t}\n\n\t// nolint: dupword\n\t//\n\t// Calculate the target difficulty by multiplying the provided starting\n\t// target difficulty by an exponential scaling factor that is determined\n\t// based on how far ahead or behind the ideal schedule the given time delta\n\t// is along with a half life that acts as a smoothing factor.\n\t//\n\t// Per DCP0011, the goal equation is:\n\t//\n\t// nextDiff = min(max(startDiff * 2^((Δt - Δh*Ib)/halfLife), 1), powLimit)\n\t//\n\t// However, in order to avoid the need to perform floating point math which\n\t// is problematic across languages due to uncertainty in floating point math\n\t// libs, the formula is implemented using a combination of fixed-point\n\t// integer arithmetic and a cubic polynomial approximation to the 2^x term.\n\t//\n\t// In particular, the goal cubic polynomial approximation over the interval\n\t// 0 <= x < 1 is:\n\t//\n\t// 2^x ~= 1 + 0.695502049712533x + 0.2262697964x^2 + 0.0782318x^3\n\t//\n\t// This approximation provides an absolute error margin < 0.013% over the\n\t// aforementioned interval of [0,1) which is well under the 0.1% error\n\t// margin needed for good results. Note that since the input domain is not\n\t// constrained to that interval, the exponent is decomposed into an integer\n\t// part, n, and a fractional part, f, such that f is in the desired range of\n\t// [0,1). By exponent rules 2^(n + f) = 2^n * 2^f, so the strategy is to\n\t// calculate the result by applying the cubic polynomial approximation to\n\t// the fractional part and using the fact that multiplying by 2^n is\n\t// equivalent to an arithmetic left or right shift depending on the sign.\n\t//\n\t// In other words, start by calculating the exponent (x) using 64.16 fixed\n\t// point and decompose it into integer (n) and fractional (f) parts as\n\t// follows:\n\t//\n\t// 2^16 * (Δt - Δh*Ib) (Δt - Δh*Ib) << 16\n\t// x = ------------------- = ------------------\n\t// halfLife halfLife\n\t//\n\t// x\n\t// n = ---- = x >> 16\n\t// 2^16\n\t//\n\t// f = x (mod 2^16) = x & 0xffff\n\t//\n\t// The use of 64.16 fixed point for the exponent means both the integer (n)\n\t// and fractional (f) parts have an additional factor of 2^16. Since the\n\t// fractional part of the exponent is cubed in the polynomial approximation\n\t// and (2^16)^3 = 2^48, the addition step in the approximation is internally\n\t// performed using 16.48 fixed point to compensate.\n\t//\n\t// In other words, the fixed point formulation of the goal cubic polynomial\n\t// approximation for the fractional part is:\n\t//\n\t// 195766423245049*f + 971821376*f^2 + 5127*f^3 + 2^47\n\t// 2^f ~= 2^16 + ---------------------------------------------------\n\t// 2^48\n\t//\n\t// Finally, the final target difficulty is calculated using x.16 fixed point\n\t// and then clamped to the valid range as follows:\n\t//\n\t// startDiff * 2^f * 2^n\n\t// nextDiff = ---------------------\n\t// 2^16\n\t//\n\t// nextDiff = min(max(nextDiff, 1), powLimit)\n\t//\n\t// NOTE: The division by the half life uses Quo instead of Div because it\n\t// must be truncated division (which is truncated towards zero as Quo\n\t// implements) as opposed to the Euclidean division that Div implements.\n\tidealTimeDelta := heightDelta * targetSecsPerBlock\n\texponentBig := big.NewInt(timeDelta - idealTimeDelta)\n\texponentBig.Lsh(exponentBig, 16)\n\texponentBig.Quo(exponentBig, big.NewInt(halfLife))\n\n\t// Decompose the exponent into integer and fractional parts. Since the\n\t// exponent is using 64.16 fixed point, the bottom 16 bits are the\n\t// fractional part and the integer part is the exponent arithmetic right\n\t// shifted by 16.\n\tfrac64 := uint64(exponentBig.Int64() & 0xffff)\n\tshifts := exponentBig.Rsh(exponentBig, 16).Int64()\n\n\t// Calculate 2^16 * 2^(fractional part) of the exponent.\n\t//\n\t// Note that a full unsigned 64-bit type is required to avoid overflow in\n\t// the internal 16.48 fixed point calculation. Also, the overall result is\n\t// guaranteed to be positive and a maximum of 17 bits, so it is safe to cast\n\t// to a uint32.\n\tconst (\n\t\tpolyCoeff1 uint64 = 195766423245049 // ceil(0.695502049712533 * 2^48)\n\t\tpolyCoeff2 uint64 = 971821376 // ceil(0.2262697964 * 2^32)\n\t\tpolyCoeff3 uint64 = 5127 // ceil(0.0782318 * 2^16)\n\t)\n\tfracFactor := uint32(1<<16 + (polyCoeff1*frac64+\n\t\tpolyCoeff2*frac64*frac64+\n\t\tpolyCoeff3*frac64*frac64*frac64+\n\t\t1<<47)>>48)\n\n\t// Calculate the target difficulty per the previous discussion:\n\t//\n\t// startDiff * 2^f * 2^n\n\t// nextDiff = ---------------------\n\t// 2^16\n\t//\n\t// Note that by exponent rules 2^n / 2^16 = 2^(n - 16). This takes\n\t// advantage of that property to reduce the multiplication by 2^n and\n\t// division by 2^16 to a single shift.\n\t//\n\t// This approach also has the benefit of lowering the maximum magnitude\n\t// relative to what would be the case when first left shifting by a larger\n\t// value and then right shifting after. Since arbitrary precision integers\n\t// are used for this implementation, it doesn't make any difference from a\n\t// correctness standpoint, however, it does potentially lower the amount of\n\t// memory for the arbitrary precision type and can be used to help prevent\n\t// overflow in implementations that use fixed precision types.\n\tnextDiff := new(big.Int).Set(startDiff)\n\tnextDiff.Mul(nextDiff, big.NewInt(int64(fracFactor)))\n\tshifts -= 16\n\tif shifts >= 0 {\n\t\tnextDiff.Lsh(nextDiff, uint(shifts))\n\t} else {\n\t\tnextDiff.Rsh(nextDiff, uint(-shifts))\n\t}\n\n\t// Limit the target difficulty to the valid hardest and easiest values.\n\t// The valid range is [1, powLimit].\n\tif nextDiff.Sign() == 0 {\n\t\t// The hardest valid target difficulty is 1 since it would be impossible\n\t\t// to find a non-negative integer less than 0.\n\t\tnextDiff.SetInt64(1)\n\t} else if nextDiff.Cmp(powLimit) > 0 {\n\t\tnextDiff.Set(powLimit)\n\t}\n\n\t// Convert the difficulty to the compact representation and return it.\n\treturn BigToCompact(nextDiff)\n}",
"func Dchkbl(t *testing.T) {\n\tvar rmax, sfmin, temp, vmax, zero float64\n\tvar _i, i, ihi, ihiin, ilo, iloin, info, j, knt, n, ninfo int\n\tvar err error\n\n\t// dummy := vf(1)\n\tscale := vf(20)\n\tscalin := vf(20)\n\tlmax := make([]int, 3)\n\ta := mf(20, 20, opts)\n\tain := mf(20, 20, opts)\n\n\tzero = 0.0\n\n\talenlist := []int{5, 5, 5, 4, 6, 5, 4, 4, 5, 6, 7, 5, 6}\n\talist := [][]float64{\n\t\t{\n\t\t\t0.1000e+01, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.2000e+01, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.3000e+01, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.4000e+01, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.5000e+01,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.1000e+01, 0.2000e+01, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.1000e+01, 0.2000e+01, 0.3000e+01, 0.0000e+00, 0.0000e+00,\n\t\t\t0.1000e+01, 0.2000e+01, 0.3000e+01, 0.4000e+01, 0.0000e+00,\n\t\t\t0.1000e+01, 0.2000e+01, 0.3000e+01, 0.4000e+01, 0.5000e+01,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.1000e+01, 0.1000e+01, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.1000e+01, 0.1000e+01, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.1000e+01, 0.1000e+01, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.1000e+01, 0.1000e+01,\n\t\t},\n\t\t{\n\t\t\t0.0000e+00, 0.2000e+01, 0.1000e+00, 0.0000e+00,\n\t\t\t0.2000e+01, 0.0000e+00, 0.0000e+00, 0.1000e+00,\n\t\t\t0.1000e+03, 0.0000e+00, 0.0000e+00, 0.2000e+01,\n\t\t\t0.0000e+00, 0.1000e+03, 0.2000e+01, 0.0000e+00,\n\t\t},\n\t\t{\n\t\t\t0.2000e+01, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.1024e+04,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.1280e+03,\n\t\t\t0.0000e+00, 0.2000e+01, 0.3000e+04, 0.0000e+00, 0.0000e+00, 0.2000e+01,\n\t\t\t0.1280e+03, 0.4000e+01, 0.4000e-02, 0.5000e+01, 0.6000e+03, 0.8000e+01,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.2000e-02, 0.2000e+01,\n\t\t\t0.8000e+01, 0.8192e+04, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.2000e+01,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.8000e+01,\n\t\t\t0.0000e+00, 0.2000e+01, 0.8192e+04, 0.2000e+01, 0.4000e+01,\n\t\t\t0.2500e-03, 0.1250e-03, 0.4000e+01, 0.0000e+00, 0.6400e+02,\n\t\t\t0.0000e+00, 0.2000e+01, 0.1024e+04, 0.4000e+01, 0.8000e+01,\n\t\t\t0.0000e+00, 0.8192e+04, 0.0000e+00, 0.0000e+00, 0.8000e+01,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01, 0.1000e+07, 0.1000e+07, 0.1000e+07,\n\t\t\t-0.2000e+07, 0.3000e+01, 0.2000e-05, 0.3000e-05,\n\t\t\t-0.3000e+07, 0.0000e+00, 0.1000e-05, 0.2000e+01,\n\t\t\t0.1000e+07, 0.0000e+00, 0.3000e-05, 0.4000e+07,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01, 0.1000e+05, 0.1000e+05, 0.1000e+05,\n\t\t\t-0.2000e+05, 0.3000e+01, 0.2000e-02, 0.3000e-02,\n\t\t\t0.0000e+00, 0.2000e+01, 0.0000e+00, -0.3000e+05,\n\t\t\t0.0000e+00, 0.0000e+00, 0.1000e+05, 0.0000e+00,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01, 0.5120e+03, 0.4096e+04, 3.2768e+04, 2.62144e+05,\n\t\t\t0.8000e+01, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.8000e+01, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.8000e+01, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.8000e+01, 0.0000e+00,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01, 0.1000e+01, 0.0000e+00, 0.1000e+01, 0.1000e+01, 0.1000e+01,\n\t\t\t0.1000e+01, 0.1000e+01, 0.0000e+00, 0.1000e+01, 0.1000e+01, 0.1000e+01,\n\t\t\t0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.1000e+01, 0.0000e+00, 0.0000e+00,\n\t\t\t0.1000e+01, 0.1000e+01, 0.0000e+00, 0.1000e+01, 0.1000e+01, 0.1000e+01,\n\t\t\t0.1000e+01, 0.1000e+01, 0.0000e+00, 0.1000e+01, 0.1000e+01, 0.1000e+01,\n\t\t},\n\t\t{\n\t\t\t0.6000e+01, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.1000e+01, 0.0000e+00,\n\t\t\t0.0000e+00, 0.4000e+01, 0.0000e+00, 0.2500e-03, 0.1250e-01, 0.2000e-01, 0.1250e+00,\n\t\t\t0.1000e+01, 0.1280e+03, 0.6400e+02, 0.0000e+00, 0.0000e+00, -0.2000e+01, 0.1600e+02,\n\t\t\t0.0000e+00, 1.6384e+04, 0.0000e+00, 0.1000e+01, -0.4000e+03, 0.2560e+03, -0.4000e+04,\n\t\t\t-0.2000e+01, -0.2560e+03, 0.0000e+00, 0.1250e-01, 0.2000e+01, 0.2000e+01, 0.3200e+02,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.8000e+01, 0.0000e+00, 0.4000e-02, 0.1250e+00, -0.2000e+00, 0.3000e+01,\n\t\t},\n\t\t{\n\t\t\t0.1000e+04, 0.2000e+01, 0.3000e+01, 0.4000e+01, 0.5000e+06,\n\t\t\t0.9000e+01, 0.0000e+00, 0.2000e-03, 0.1000e+01, 0.3000e+01,\n\t\t\t0.0000e+00, -0.3000e+03, 0.2000e+01, 0.1000e+01, 0.1000e+01,\n\t\t\t0.9000e+01, 0.2000e-02, 0.1000e+01, 0.1000e+01, -0.1000e+04,\n\t\t\t0.6000e+01, 0.2000e+03, 0.1000e+01, 0.6000e+03, 0.3000e+01,\n\t\t},\n\t\t{\n\t\t\t1.0000e+00, 1.0000e+120, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t1.0000e-120, 1.0000e+00, 1.0000e+120, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 1.0000e-120, 1.0000e+00, 1.0000e+120, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 1.0000e-120, 1.0000e+00, 1.0000e+120, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e-120, 1.0000e+00, 1.0000e+120,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 1.0000e-120, 1.0000e+00,\n\t\t},\n\t}\n\tilolist := []int{1, 1, 1, 1, 4, 1, 1, 1, 1, 2, 2, 1, 1}\n\tihilist := []int{1, 1, 1, 4, 6, 5, 4, 4, 5, 5, 5, 5, 6}\n\tainlist := [][]float64{\n\t\t{\n\t\t\t0.1000e+01, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.2000e+01, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.3000e+01, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.4000e+01, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.5000e+01,\n\t\t},\n\t\t{\n\t\t\t0.5000e+01, 0.4000e+01, 0.3000e+01, 0.2000e+01, 0.1000e+01,\n\t\t\t0.0000e+00, 0.4000e+01, 0.3000e+01, 0.2000e+01, 0.1000e+01,\n\t\t\t0.0000e+00, 0.0000e+00, 0.3000e+01, 0.2000e+01, 0.1000e+01,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.2000e+01, 0.1000e+01,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.1000e+01,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01, 0.1000e+01, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.1000e+01, 0.1000e+01, 0.0000e+00, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.1000e+01, 0.1000e+01, 0.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.1000e+01, 0.1000e+01,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.1000e+01,\n\t\t},\n\t\t{\n\t\t\t0.0000e-03, 2.0000e+00, 3.2000e+00, 0.0000e-03,\n\t\t\t2.0000e+00, 0.0000e-03, 0.0000e-03, 3.2000e+00,\n\t\t\t3.1250e+00, 0.0000e-03, 0.0000e-03, 2.0000e+00,\n\t\t\t0.0000e-03, 3.1250e+00, 2.0000e+00, 0.0000e-03,\n\t\t},\n\t\t{\n\t\t\t0.5000e+01, 0.4000e-02, 0.6000e+03, 0.1024e+04, 0.5000e+00, 0.8000e+01,\n\t\t\t0.0000e+00, 0.3000e+04, 0.0000e+00, 0.0000e+00, 0.2500e+00, 0.2000e+01,\n\t\t\t0.0000e+00, 0.0000e+00, 0.2000e-02, 0.0000e+00, 0.0000e+00, 0.2000e+01,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.2000e+01, 0.0000e+00, 0.1280e+03,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.1024e+04,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.6400e+02, 0.1024e+04, 0.2000e+01,\n\t\t},\n\t\t{\n\t\t\t1.0000e+00, 0.0000e-03, 0.0000e-03, 0.0000e-03, 2.0000e+00,\n\t\t\t0.0000e-03, 2.0000e+00, 1.0240e+03, 16.0000e+00, 16.0000e+00,\n\t\t\t3.2000e-02, 1.0000e-03, 4.0000e+00, 0.0000e-03, 2.0480e+03,\n\t\t\t0.0000e-03, 250.0000e-03, 16.0000e+00, 4.0000e+00, 4.0000e+00,\n\t\t\t0.0000e-03, 2.0480e+03, 0.0000e-03, 0.0000e-03, 8.0000e+00,\n\t\t},\n\t\t{\n\t\t\t1.0000e+00, 1.0000e+06, 2.0000e+06, 1.0000e+06,\n\t\t\t-2.0000e+06, 3.0000e+00, 4.0000e-06, 3.0000e-06,\n\t\t\t-1.5000e+06, 0.0000e-03, 1.0000e-06, 1.0000e+00,\n\t\t\t1.0000e+06, 0.0000e-03, 6.0000e-06, 4.0000e+06,\n\t\t},\n\t\t{\n\t\t\t1.0000e+00, 10.0000e+03, 10.0000e+03, 5.0000e+03,\n\t\t\t-20.0000e+03, 3.0000e+00, 2.0000e-03, 1.5000e-03,\n\t\t\t0.0000e-03, 2.0000e+00, 0.0000e-03, -15.0000e+03,\n\t\t\t0.0000e-03, 0.0000e-03, 20.0000e+03, 0.0000e-03,\n\t\t},\n\t\t{\n\t\t\t1.0000e+00, 32.0000e+00, 32.0000e+00, 32.0000e+000, 32.0000e+00,\n\t\t\t128.0000e+00, 0.0000e-03, 0.0000e-03, 0.0000e-003, 0.0000e-03,\n\t\t\t0.0000e-03, 64.0000e+00, 0.0000e-03, 0.0000e-003, 0.0000e-03,\n\t\t\t0.0000e-03, 0.0000e-03, 64.0000e+00, 0.0000e-003, 0.0000e-03,\n\t\t\t0.0000e-03, 0.0000e-03, 0.0000e-03, 64.0000e+000, 0.0000e-03,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01,\n\t\t\t0.0000e+00, 0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01,\n\t\t\t0.0000e+00, 0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01,\n\t\t\t0.0000e+00, 0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01,\n\t\t\t0.0000e+00, 0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01,\n\t\t\t0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.1000e+01,\n\t\t},\n\t\t{\n\t\t\t6.4000e+01, 1.0000e+00, 5.00000e-01, 0.0000e+00, 0.0000e+00, 1.0000e+00, -2.0000e+00,\n\t\t\t0.0000e+00, 4.0000e+00, 5.00000e-01, 1.0240e+00, 8.0000e-01, 0.0000e+00, 2.5600e+00,\n\t\t\t0.0000e+00, 2.0000e+00, 3.00000e+00, 4.0960e+00, 2.0000e+00, 0.0000e+00, -6.4000e+00,\n\t\t\t0.0000e+00, 4.0000e+00, -3.90625e+00, 1.0000e+00, -6.2500e+00, 0.0000e+00, 8.0000e+00,\n\t\t\t0.0000e+00, -4.0000e+00, 2.00000e+00, 8.0000e-01, 2.0000e+00, -4.0000e+00, 4.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.00000e+00, 0.0000e+00, 0.0000e+00, 6.0000e+00, 1.0000e+00,\n\t\t\t0.0000e+00, 0.0000e+00, 0.00000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00,\n\t\t},\n\t\t{\n\t\t\t1.0000e+03, 3.1250e-02, 3.7500e-01, 3.1250e-02, 1.95312500e+03,\n\t\t\t5.7600e+02, 0.0000e+00, 1.6000e-03, 5.0000e-01, 7.50000000e-01,\n\t\t\t0.0000e+00, -3.7500e+01, 2.0000e+00, 6.2500e-02, 3.12500000e-02,\n\t\t\t1.1520e+03, 4.0000e-03, 1.6000e+01, 1.0000e+00, -5.00000000e+02,\n\t\t\t1.5360e+03, 8.0000e+02, 3.2000e+01, 1.2000e+03, 3.00000000e+00,\n\t\t},\n\t\t{\n\t\t\t0.10000000000000000000e+01, 0.63448545932891229313e+04, 0.00000000000000000000e+00, 0.00000000000000000000e+00, 0.00000000000000000000e+00, 0.00000000000000000000e+00,\n\t\t\t0.15760802478557791348e-03, 0.10000000000000000000e+01, 0.63448545932891229313e+04, 0.00000000000000000000e+00, 0.00000000000000000000e+00, 0.00000000000000000000e+00,\n\t\t\t0.00000000000000000000e+00, 0.15760802478557791348e-03, 0.10000000000000000000e+01, 0.31724272966445614657e+04, 0.00000000000000000000e+00, 0.00000000000000000000e+00,\n\t\t\t0.00000000000000000000e+00, 0.00000000000000000000e+00, 0.31521604957115582695e-03, 0.10000000000000000000e+01, 0.15862136483222807328e+04, 0.00000000000000000000e+00,\n\t\t\t0.00000000000000000000e+00, 0.00000000000000000000e+00, 0.00000000000000000000e+00, 0.63043209914231165391e-03, 0.10000000000000000000e+01, 0.79310682416114036641e+03,\n\t\t\t0.00000000000000000000e+00, 0.00000000000000000000e+00, 0.00000000000000000000e+00, 0.00000000000000000000e+00, 0.12608641982846233078e-02, 0.10000000000000000000e+01,\n\t\t},\n\t}\n\tscalelist := [][]float64{\n\t\t{0.1000e+01, 0.2000e+01, 0.3000e+01, 0.4000e+01, 0.5000e+01},\n\t\t{0.1000e+01, 0.2000e+01, 0.3000e+01, 0.2000e+01, 0.1000e+01},\n\t\t{0.1000e+01, 0.2000e+01, 0.3000e+01, 0.2000e+01, 0.1000e+01},\n\t\t{62.5000e-03, 62.5000e-03, 2.0000e+00, 2.0000e+00},\n\t\t{0.4000e+01, 0.3000e+01, 0.5000e+01, 0.8000e+01, 0.1250e+00, 0.1000e+01},\n\t\t{8.0000e+00, 500.0000e-03, 62.5000e-03, 4.0000e+00, 2.0000e+00},\n\t\t{1.0000e+00, 1.0000e+00, 2.0000e+00, 1.0000e+00},\n\t\t{1.0000e+00, 1.0000e+00, 1.0000e+00, 500.0000e-03},\n\t\t{256.0000e+00, 16.0000e+00, 2.0000e+00, 250.0000e-03, 31.2500e-03},\n\t\t{0.3000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01, 0.1000e+01, 0.4000e+01},\n\t\t{3.0000e+00, 7.812500e-03, 3.1250e-02, 3.2000e+01, 5.0000e-01, 1.0000e+00, 6.0000e+00},\n\t\t{3.2000e+01, 5.0000e-01, 4.0000e+00, 2.5000e-01, 1.2500e-01},\n\t\t{2.494800386918399765e+291, 1.582914569427869018e+175, 1.004336277661868922e+59, 3.186183822264904554e-58, 5.053968264940243633e-175, 0.40083367200179455560e-291},\n\t}\n\n\tlmax[0] = 0\n\tlmax[1] = 0\n\tlmax[2] = 0\n\tninfo = 0\n\tknt = 0\n\trmax = zero\n\tvmax = zero\n\tsfmin = golapack.Dlamch(SafeMinimum)\n\t// meps = golapack.Dlamch(Epsilon)\n\n\tfor _i, n = range alenlist {\n\t\tfor i = 1; i <= n; i++ {\n\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\ta.Set(i-1, j-1, alist[_i][(i-1)*(n)+j-1])\n\t\t\t}\n\t\t}\n\n\t\tiloin = ilolist[_i]\n\t\tihiin = ihilist[_i]\n\t\tfor i = 1; i <= n; i++ {\n\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\tain.Set(i-1, j-1, ainlist[_i][(i-1)*(n)+j-1])\n\t\t\t}\n\t\t}\n\t\tfor i = 1; i <= n; i++ {\n\t\t\tscalin.Set(i-1, scalelist[_i][i-1])\n\t\t}\n\n\t\t// anorm = Dlange('M', &n, &n, a, &lda, dummy)\n\t\tknt = knt + 1\n\n\t\tif ilo, ihi, err = golapack.Dgebal('B', n, a, scale); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif info != 0 {\n\t\t\tt.Fail()\n\t\t\tninfo = ninfo + 1\n\t\t\tlmax[0] = knt\n\t\t}\n\n\t\tif ilo != iloin || ihi != ihiin {\n\t\t\tt.Fail()\n\t\t\tninfo = ninfo + 1\n\t\t\tlmax[1] = knt\n\t\t}\n\n\t\tfor i = 1; i <= n; i++ {\n\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\ttemp = math.Max(a.Get(i-1, j-1), ain.Get(i-1, j-1))\n\t\t\t\ttemp = math.Max(temp, sfmin)\n\t\t\t\tvmax = math.Max(vmax, math.Abs(a.Get(i-1, j-1)-ain.Get(i-1, j-1))/temp)\n\t\t\t}\n\t\t}\n\n\t\tfor i = 1; i <= n; i++ {\n\t\t\ttemp = math.Max(scale.Get(i-1), scalin.Get(i-1))\n\t\t\ttemp = math.Max(temp, sfmin)\n\t\t\tvmax = math.Max(vmax, math.Abs(scale.Get(i-1)-scalin.Get(i-1))/temp)\n\t\t}\n\n\t\tif vmax > rmax {\n\t\t\tlmax[2] = knt\n\t\t\trmax = vmax\n\t\t}\n\n\t}\n\n\tfmt.Printf(\" .. test output of dgebal .. \\n\")\n\n\tfmt.Printf(\"\\tvalue of largest test error = %12.3E\\n\", rmax)\n\tfmt.Printf(\"\\texample number where info is not zero = %4d\\n\", lmax[0])\n\tfmt.Printf(\"\\texample number where ilo or ihi wrong = %4d\\n\", lmax[1])\n\tfmt.Printf(\"\\texample number having largest error = %4d\\n\", lmax[2])\n\tfmt.Printf(\"\\tnumber of examples where info is not 0 = %4d\\n\", ninfo)\n\tfmt.Printf(\"\\ttotal number of examples tested = %4d\\n\", knt)\n}",
"func VCVTTSS2SIQ_SAE(x, r operand.Op) { ctx.VCVTTSS2SIQ_SAE(x, r) }",
"func Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (csu, snu, csv, snv, csq, snq float64) {\n\tvar a, aua11, aua12, aua21, aua22, avb11, avb12, avb21, avb22, b, c, csl, csr, d, snl, snr, ua11, ua11r, ua12, ua21, ua22, ua22r, vb11, vb11r, vb12, vb21, vb22, vb22r, zero float64\n\n\tzero = 0.0\n\n\tif upper {\n\t\t// Input matrices A and B are upper triangular matrices\n\t\t//\n\t\t// Form matrix C = A*adj(B) = ( a b )\n\t\t// ( 0 d )\n\t\ta = a1 * b3\n\t\td = a3 * b1\n\t\tb = a2*b1 - a1*b2\n\n\t\t// The SVD of real 2-by-2 triangular C\n\t\t//\n\t\t// ( CSL -SNL )*( A B )*( CSR SNR ) = ( R 0 )\n\t\t// ( SNL CSL ) ( 0 D ) ( -SNR CSR ) ( 0 T )\n\t\t_, _, snr, csr, snl, csl = Dlasv2(a, b, d)\n\n\t\tif math.Abs(csl) >= math.Abs(snl) || math.Abs(csr) >= math.Abs(snr) {\n\t\t\t// Compute the (1,1) and (1,2) elements of U**T *A and V**T *B,\n\t\t\t// and (1,2) element of |U|**T *|A| and |V|**T *|B|.\n\t\t\tua11r = csl * a1\n\t\t\tua12 = csl*a2 + snl*a3\n\n\t\t\tvb11r = csr * b1\n\t\t\tvb12 = csr*b2 + snr*b3\n\n\t\t\taua12 = math.Abs(csl)*math.Abs(a2) + math.Abs(snl)*math.Abs(a3)\n\t\t\tavb12 = math.Abs(csr)*math.Abs(b2) + math.Abs(snr)*math.Abs(b3)\n\n\t\t\t// zero (1,2) elements of U**T *A and V**T *B\n\t\t\tif (math.Abs(ua11r) + math.Abs(ua12)) != zero {\n\t\t\t\tif aua12/(math.Abs(ua11r)+math.Abs(ua12)) <= avb12/(math.Abs(vb11r)+math.Abs(vb12)) {\n\t\t\t\t\tcsq, snq, _ = Dlartg(-ua11r, ua12)\n\t\t\t\t} else {\n\t\t\t\t\tcsq, snq, _ = Dlartg(-vb11r, vb12)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcsq, snq, _ = Dlartg(-vb11r, vb12)\n\t\t\t}\n\n\t\t\tcsu = csl\n\t\t\tsnu = -snl\n\t\t\tcsv = csr\n\t\t\tsnv = -snr\n\n\t\t} else {\n\t\t\t// Compute the (2,1) and (2,2) elements of U**T *A and V**T *B,\n\t\t\t// and (2,2) element of |U|**T *|A| and |V|**T *|B|.\n\t\t\tua21 = -snl * a1\n\t\t\tua22 = -snl*a2 + csl*a3\n\n\t\t\tvb21 = -snr * b1\n\t\t\tvb22 = -snr*b2 + csr*b3\n\n\t\t\taua22 = math.Abs(snl)*math.Abs(a2) + math.Abs(csl)*math.Abs(a3)\n\t\t\tavb22 = math.Abs(snr)*math.Abs(b2) + math.Abs(csr)*math.Abs(b3)\n\n\t\t\t// zero (2,2) elements of U**T*A and V**T*B, and then swap.\n\t\t\tif (math.Abs(ua21) + math.Abs(ua22)) != zero {\n\t\t\t\tif aua22/(math.Abs(ua21)+math.Abs(ua22)) <= avb22/(math.Abs(vb21)+math.Abs(vb22)) {\n\t\t\t\t\tcsq, snq, _ = Dlartg(-ua21, ua22)\n\t\t\t\t} else {\n\t\t\t\t\tcsq, snq, _ = Dlartg(-vb21, vb22)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcsq, snq, _ = Dlartg(-vb21, vb22)\n\t\t\t}\n\n\t\t\tcsu = snl\n\t\t\tsnu = csl\n\t\t\tcsv = snr\n\t\t\tsnv = csr\n\n\t\t}\n\n\t} else {\n\n\t\t// Input matrices A and B are lower triangular matrices\n\t\t//\n\t\t// Form matrix C = A*adj(B) = ( a 0 )\n\t\t// ( c d )\n\t\ta = a1 * b3\n\t\td = a3 * b1\n\t\tc = a2*b3 - a3*b2\n\n\t\t// The SVD of real 2-by-2 triangular C\n\t\t//\n\t\t// ( CSL -SNL )*( A 0 )*( CSR SNR ) = ( R 0 )\n\t\t// ( SNL CSL ) ( C D ) ( -SNR CSR ) ( 0 T )\n\t\t_, _, snr, csr, snl, csl = Dlasv2(a, c, d)\n\n\t\tif math.Abs(csr) >= math.Abs(snr) || math.Abs(csl) >= math.Abs(snl) {\n\t\t\t// Compute the (2,1) and (2,2) elements of U**T *A and V**T *B,\n\t\t\t// and (2,1) element of |U|**T *|A| and |V|**T *|B|.\n\t\t\tua21 = -snr*a1 + csr*a2\n\t\t\tua22r = csr * a3\n\n\t\t\tvb21 = -snl*b1 + csl*b2\n\t\t\tvb22r = csl * b3\n\n\t\t\taua21 = math.Abs(snr)*math.Abs(a1) + math.Abs(csr)*math.Abs(a2)\n\t\t\tavb21 = math.Abs(snl)*math.Abs(b1) + math.Abs(csl)*math.Abs(b2)\n\n\t\t\t// zero (2,1) elements of U**T *A and V**T *B.\n\t\t\tif (math.Abs(ua21) + math.Abs(ua22r)) != zero {\n\t\t\t\tif aua21/(math.Abs(ua21)+math.Abs(ua22r)) <= avb21/(math.Abs(vb21)+math.Abs(vb22r)) {\n\t\t\t\t\tcsq, snq, _ = Dlartg(ua22r, ua21)\n\t\t\t\t} else {\n\t\t\t\t\tcsq, snq, _ = Dlartg(vb22r, vb21)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcsq, snq, _ = Dlartg(vb22r, vb21)\n\t\t\t}\n\n\t\t\tcsu = csr\n\t\t\tsnu = -snr\n\t\t\tcsv = csl\n\t\t\tsnv = -snl\n\n\t\t} else {\n\t\t\t// Compute the (1,1) and (1,2) elements of U**T *A and V**T *B,\n\t\t\t// and (1,1) element of |U|**T *|A| and |V|**T *|B|.\n\t\t\tua11 = csr*a1 + snr*a2\n\t\t\tua12 = snr * a3\n\n\t\t\tvb11 = csl*b1 + snl*b2\n\t\t\tvb12 = snl * b3\n\n\t\t\taua11 = math.Abs(csr)*math.Abs(a1) + math.Abs(snr)*math.Abs(a2)\n\t\t\tavb11 = math.Abs(csl)*math.Abs(b1) + math.Abs(snl)*math.Abs(b2)\n\n\t\t\t// zero (1,1) elements of U**T*A and V**T*B, and then swap.\n\t\t\tif (math.Abs(ua11) + math.Abs(ua12)) != zero {\n\t\t\t\tif aua11/(math.Abs(ua11)+math.Abs(ua12)) <= avb11/(math.Abs(vb11)+math.Abs(vb12)) {\n\t\t\t\t\tcsq, snq, _ = Dlartg(ua12, ua11)\n\t\t\t\t} else {\n\t\t\t\t\tcsq, snq, _ = Dlartg(vb12, vb11)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcsq, snq, _ = Dlartg(vb12, vb11)\n\t\t\t}\n\n\t\t\tcsu = snr\n\t\t\tsnu = csr\n\t\t\tcsv = snl\n\t\t\tsnv = csl\n\n\t\t}\n\n\t}\n\n\treturn\n}",
"func Dsbgvx(jobz, _range byte, uplo mat.MatUplo, n, ka, kb int, ab, bb, q *mat.Matrix, vl, vu float64, il, iu int, abstol float64, w *mat.Vector, z *mat.Matrix, work *mat.Vector, iwork, ifail *[]int) (m, info int, err error) {\n\tvar alleig, indeig, test, upper, valeig, wantz bool\n\tvar order, vect byte\n\tvar one, tmp1, zero float64\n\tvar i, indd, inde, indee, indibl, indisp, indiwo, indwrk, itmp1, j, jj int\n\n\tzero = 0.0\n\tone = 1.0\n\n\t// Test the input parameters.\n\twantz = jobz == 'V'\n\tupper = uplo == Upper\n\talleig = _range == 'A'\n\tvaleig = _range == 'V'\n\tindeig = _range == 'I'\n\n\tif !(wantz || jobz == 'N') {\n\t\terr = fmt.Errorf(\"!(wantz || jobz == 'N'): jobz='%c'\", jobz)\n\t} else if !(alleig || valeig || indeig) {\n\t\terr = fmt.Errorf(\"!(alleig || valeig || indeig): _range='%c'\", _range)\n\t} else if !(upper || uplo == Lower) {\n\t\terr = fmt.Errorf(\"!(upper || uplo == Lower): uplo=%s\", uplo)\n\t} else if n < 0 {\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if ka < 0 {\n\t\terr = fmt.Errorf(\"ka < 0: ka=%v\", ka)\n\t} else if kb < 0 || kb > ka {\n\t\terr = fmt.Errorf(\"kb < 0 || kb > ka: kb=%v, ka=%v\", kb, ka)\n\t} else if ab.Rows < ka+1 {\n\t\terr = fmt.Errorf(\"ab.Rows < ka+1: ab.Rows=%v, ka=%v\", ab.Rows, ka)\n\t} else if bb.Rows < kb+1 {\n\t\terr = fmt.Errorf(\"bb.Rows < kb+1: bb.Rows=%v, kb=%v\", bb.Rows, kb)\n\t} else if q.Rows < 1 || (wantz && q.Rows < n) {\n\t\terr = fmt.Errorf(\"q.Rows < 1 || (wantz && q.Rows < n): jobz='%c', q.Rows=%v, n=%v\", jobz, q.Rows, n)\n\t} else {\n\t\tif valeig {\n\t\t\tif n > 0 && vu <= vl {\n\t\t\t\terr = fmt.Errorf(\"n > 0 && vu <= vl: n=%v, vu=%v, vl=%v\", n, vu, vl)\n\t\t\t}\n\t\t} else if indeig {\n\t\t\tif il < 1 || il > max(1, n) {\n\t\t\t\terr = fmt.Errorf(\"il < 1 || il > max(1, n): il=%v, iu=%v, n=%v\", il, iu, n)\n\t\t\t} else if iu < min(n, il) || iu > n {\n\t\t\t\terr = fmt.Errorf(\"iu < min(n, il) || iu > n: iu=%v, il=%v, n=%v\", iu, il, n)\n\t\t\t}\n\t\t}\n\t}\n\tif err == nil {\n\t\tif z.Rows < 1 || (wantz && z.Rows < n) {\n\t\t\terr = fmt.Errorf(\"z.Rows < 1 || (wantz && z.Rows < n): jobz='%c', z.Rows=%v, n=%v\", jobz, z.Rows, n)\n\t\t}\n\t}\n\n\tif err != nil {\n\t\tgltest.Xerbla2(\"Dsbgvx\", err)\n\t\treturn\n\t}\n\n\t// Quick return if possible\n\tm = 0\n\tif n == 0 {\n\t\treturn\n\t}\n\n\t// Form a split Cholesky factorization of B.\n\tif info, err = Dpbstf(uplo, n, kb, bb); err != nil {\n\t\tpanic(err)\n\t}\n\tif info != 0 {\n\t\tinfo = n + info\n\t\treturn\n\t}\n\n\t// Transform problem to standard eigenvalue problem.\n\tif err = Dsbgst(jobz, uplo, n, ka, kb, ab, bb, q, work); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Reduce symmetric band matrix to tridiagonal form.\n\tindd = 1\n\tinde = indd + n\n\tindwrk = inde + n\n\tif wantz {\n\t\tvect = 'U'\n\t} else {\n\t\tvect = 'N'\n\t}\n\tif err = Dsbtrd(vect, uplo, n, ka, ab, work.Off(indd-1), work.Off(inde-1), q, work.Off(indwrk-1)); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// If all eigenvalues are desired and ABSTOL is less than or equal\n\t// to zero, then call DSTERF or SSTEQR. If this fails for some\n\t// eigenvalue, then try DSTEBZ.\n\ttest = false\n\tif indeig {\n\t\tif il == 1 && iu == n {\n\t\t\ttest = true\n\t\t}\n\t}\n\tif (alleig || test) && (abstol <= zero) {\n\t\tw.Copy(n, work.Off(indd-1), 1, 1)\n\t\tindee = indwrk + 2*n\n\t\twork.Off(indee-1).Copy(n-1, work.Off(inde-1), 1, 1)\n\t\tif !wantz {\n\t\t\tif info, err = Dsterf(n, w, work.Off(indee-1)); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t} else {\n\t\t\tDlacpy(Full, n, n, q, z)\n\t\t\tif info, err = Dsteqr(jobz, n, w, work.Off(indee-1), z, work.Off(indwrk-1)); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tif info == 0 {\n\t\t\t\tfor i = 1; i <= n; i++ {\n\t\t\t\t\t(*ifail)[i-1] = 0\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif info == 0 {\n\t\t\tm = n\n\t\t\tgoto label30\n\t\t}\n\t\tinfo = 0\n\t}\n\n\t// Otherwise, call DSTEBZ and, if eigenvectors are desired,\n\t// call DSTEIN.\n\tif wantz {\n\t\torder = 'B'\n\t} else {\n\t\torder = 'E'\n\t}\n\tindibl = 1\n\tindisp = indibl + n\n\tindiwo = indisp + n\n\tif m, _, info, err = Dstebz(_range, order, n, vl, vu, il, iu, abstol, work.Off(indd-1), work.Off(inde-1), w, toSlice(iwork, indibl-1), toSlice(iwork, indisp-1), work.Off(indwrk-1), toSlice(iwork, indiwo-1)); err != nil {\n\t\tpanic(err)\n\t}\n\n\tif wantz {\n\t\tif info, err = Dstein(n, work.Off(indd-1), work.Off(inde-1), m, w, toSlice(iwork, indibl-1), toSlice(iwork, indisp-1), z, work.Off(indwrk-1), toSlice(iwork, indiwo-1), ifail); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\t// Apply transformation matrix used in reduction to tridiagonal\n\t\t// form to eigenvectors returned by DSTEIN.\n\t\tfor j = 1; j <= m; j++ {\n\t\t\twork.Copy(n, z.Off(0, j-1).Vector(), 1, 1)\n\t\t\tif err = z.Off(0, j-1).Vector().Gemv(NoTrans, n, n, one, q, work, 1, zero, 1); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t}\n\nlabel30:\n\t;\n\n\t// If eigenvalues are not in order, then sort them, along with\n\t// eigenvectors.\n\tif wantz {\n\t\tfor j = 1; j <= m-1; j++ {\n\t\t\ti = 0\n\t\t\ttmp1 = w.Get(j - 1)\n\t\t\tfor jj = j + 1; jj <= m; jj++ {\n\t\t\t\tif w.Get(jj-1) < tmp1 {\n\t\t\t\t\ti = jj\n\t\t\t\t\ttmp1 = w.Get(jj - 1)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif i != 0 {\n\t\t\t\titmp1 = (*iwork)[indibl+i-1-1]\n\t\t\t\tw.Set(i-1, w.Get(j-1))\n\t\t\t\t(*iwork)[indibl+i-1-1] = (*iwork)[indibl+j-1-1]\n\t\t\t\tw.Set(j-1, tmp1)\n\t\t\t\t(*iwork)[indibl+j-1-1] = itmp1\n\t\t\t\tz.Off(0, j-1).Vector().Swap(n, z.Off(0, i-1).Vector(), 1, 1)\n\t\t\t\tif info != 0 {\n\t\t\t\t\titmp1 = (*ifail)[i-1]\n\t\t\t\t\t(*ifail)[i-1] = (*ifail)[j-1]\n\t\t\t\t\t(*ifail)[j-1] = itmp1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}",
"func VGETMANTSD_SAE_Z(i, x, x1, k, x2 operand.Op) { ctx.VGETMANTSD_SAE_Z(i, x, x1, k, x2) }",
"func main() {\n\tsampleTemp := minSampleTemp\n\n\tmaximumTable := table.NewOutTable(\"L\", \"1/L\", \n\t\t\"Critical Temperature\", \"Max Specific Heat\", \"Max Specific Heat Per Site\")\n\tmaximumTable.SetHeader(fmt.Sprintf(\"Created with %g trials per grid.\",\n\t\tmath.Pow(10, maxTrialsPow)))\n\n\tfor widthPow := minPow; widthPow <= maxPow; widthPow++ {\n\t\tcols := make([]string, 1 + 2 * (maxTrialsPow - minTrialsPow + 1))\n\t\tcols[0] = \"Temperature\"\n\n\t\tfcols := make([][]float64, int((maxTemp - minTemp) / tempStep))\n\t\tfor i := 0; i < len(fcols); i++ {\n\t\t\tfcols[i] = make([]float64, 1 + 2 * (maxTrialsPow - minTrialsPow + 1))\n\t\t}\n\n\t\tsecs1 := 0.0\n\t\tsecs2 := 0.0\n\n\t\tfmt.Printf(\"\\n%d-Width Grid:\\n\", 1<<widthPow)\n\t\tfor i := 0; i <= maxTrialsPow - minTrialsPow; i++ {\n\t\t\ttrials := int(math.Pow(10, float64(minTrialsPow + i)))\n\t\t\tfmt.Printf(\" Running %d trial suite\\n\", trials)\n\n\t\t\tcols[2 * i + 1] = fmt.Sprintf(\"E (%d)\", trials)\n\t\t\tcols[2 * i + 2] = fmt.Sprintf(\"C (%d)\", trials)\n\n\t\t\tinfo := &ising.SweepInfo{\n\t\t\t\tising.New(ising.Grid2DType, uint32(widthPow)),\n\t\t\t\tising.IterSweep,\n\t\t\t\tmcrand.New(mcrand.Xorshift, int64(time.Now().UnixNano())),\n\t\t\t\tsampleTemp,\n\t\t\t}\n\t\t\t\n\t\t\tt0 := time.Now().UnixNano()\n\t\t\tising.SweepStatistics(info, initialSweeps, trials)\n\t\t\tt1 := time.Now().UnixNano()\n\t\t\tsecs1 += float64(t1 - t0) / 1e9\n\n\t\t\th := info.Im.EnergyHistogram()\n\n\t\t\tminValidTemp, maxValidTemp := maxTemp, minTemp\n\t\t\tfor j := 0; j < len(fcols); j++ {\n\t\t\t\ttemp := minTemp + float64(j) * tempStep\n\t\t\n\t\t\t\tE := h.Energy(sampleTemp, temp)\n\t\t\t\tC := h.SpecificHeat(sampleTemp, temp)\n\n\t\t\t\tif !math.IsNaN(C) && !math.IsInf(C, 0) {\n\t\t\t\t\tif temp > maxValidTemp {\n\t\t\t\t\t\tmaxValidTemp = temp\n\t\t\t\t\t}\n\t\t\t\t\tif temp < minValidTemp {\n\t\t\t\t\t\tminValidTemp = temp\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfcols[j][2 * i + 1] = E / float64(info.Im.Sites())\n\t\t\t\tfcols[j][2 * i + 2] = C / float64(info.Im.Sites())\n\t\t\t}\n\n\t\t\tif i + minTrialsPow == maxTrialsPow {\n\t\t\t\ttCrit := h.CriticalTemp(sampleTemp, minValidTemp, maxValidTemp)\n\t\t\t\tcCrit := h.SpecificHeat(sampleTemp, tCrit)\n\t\t\t\tmaximumTable.AddRow(float64(int(1 << widthPow)),\n\t\t\t\t\t1.0 / float64(int(1 << widthPow)), tCrit,\n\t\t\t\t\tcCrit, cCrit / float64(info.Im.Sites()))\n\n\t\t\t\tsampleTemp = tCrit\n\t\t\t}\n\t\t\n\t\t\tt2 := time.Now().UnixNano()\n\t\t\tsecs2 += float64(t2 - t1) / 1e9\n\t\t}\n\n\t\theaderString := fmt.Sprintf(\n\t\t\t\"%16s: %g\\n%16s: %d\\n%16s: %d\\n\" + \n\t\t\t\t\"%16s: %s\\n%16s: %s\\n%16s: %g\\n%20s: %g\",\n\t\t\t\"Sample Temperature\", sampleTemp,\n\t\t\t\"Initial Sweeps\", initialSweeps,\n\t\t\t\"Width\", 1<<widthPow,\n\t\t\t\"Generator\", \"Xorshift\",\n\t\t\t\"Sweep Pattern\", \"IterSweep\",\n\t\t\t\"Total Sweep Time\", secs1,\n\t\t\t\"Total Histogram Time\", secs2)\n\t\t\n\t\tt := table.NewOutTable(cols...)\n\n\t\tt.SetHeader(headerString)\n\n\t\tfor i := 0; i < len(fcols); i++ {\n\t\t\tif !math.IsNaN(fcols[i][1]) {\n\t\t\t\tfcols[i][0] = minTemp + tempStep * float64(i)\n\t\t\t\tt.AddRow(fcols[i]...)\n\t\t\t}\n\t\t}\n\n\t\tt.Write(table.KeepHeader, \n\t\t\tfmt.Sprintf(\"tables/iter/hist-temp%d.table\", 1<<widthPow))\n\t}\n\n\tmaximumTable.Write(table.KeepHeader, \"tables/iter/hist-maximum.table\")\n}",
"func trace(matrix [][]int, p []rune, t []rune, minCols []int, op Options) ([]Match, error) {\n\t// For each min alignment found, do a traceback\n\t// I need the start, and end releative to the text, and the distance\n\t// I have the end and the dist, just need the start\n\tmatches := []Match{}\n\tfor _, min := range minCols {\n\t\t// Set the 'corner' that we will start looking in\n\t\ti, j := len(p), min\n\n\t\tfor i > 0 {\n\t\t\tdiag, vert, horz := MaxInt, MaxInt, MaxInt\n\t\t\tvar delt int\n\t\t\tif i > 0 && j > 0 {\n\t\t\t\tif op.Matches(p[i-1], t[j-1]) {\n\t\t\t\t\tdelt = 0\n\t\t\t\t} else {\n\t\t\t\t\tdelt = op.SubCost\n\t\t\t\t}\n\t\t\t\tdiag = matrix[i-1][j-1] + delt\n\t\t\t}\n\t\t\tif i > 0 {\n\t\t\t\tvert = matrix[i-1][j] + op.DelCost\n\t\t\t}\n\t\t\tif j > 0 {\n\t\t\t\thorz = matrix[i][j-1] + op.InsCost\n\t\t\t}\n\t\t\tif diag <= vert && diag <= horz {\n\t\t\t\t// diagonal was best, it was a match or mismatch\n\t\t\t\ti--\n\t\t\t\tj--\n\t\t\t} else if vert <= horz {\n\t\t\t\t// vertical was best, it was an insertion\n\t\t\t\ti--\n\t\t\t} else {\n\t\t\t\t// horizontal was best, it was a deletion\n\t\t\t\tj--\n\t\t\t}\n\t\t}\n\t\tmatches = append(matches, Match{Start: j, End: min, Dist: matrix[len(p)][min]})\n\t}\n\treturn matches, nil\n}",
"func ECDH_ECIES_ENCRYPT(sha int, P1 []byte, P2 []byte, RNG *core.RAND, W []byte, M []byte, V []byte, T []byte) []byte {\n\tvar Z [EFS]byte\n\tvar VZ [3*EFS + 1]byte\n\tvar K1 [AESKEY]byte\n\tvar K2 [AESKEY]byte\n\tvar U [EGS]byte\n\n\tif ECDH_KEY_PAIR_GENERATE(RNG, U[:], V) != 0 {\n\t\treturn nil\n\t}\n\tif ECDH_ECPSVDP_DH(U[:], W, Z[:], 0) != 0 {\n\t\treturn nil\n\t}\n\n\tfor i := 0; i < 2*EFS+1; i++ {\n\t\tVZ[i] = V[i]\n\t}\n\tfor i := 0; i < EFS; i++ {\n\t\tVZ[2*EFS+1+i] = Z[i]\n\t}\n\n\tK := core.KDF2(core.MC_SHA2, sha, VZ[:], P1, 2*AESKEY)\n\n\tfor i := 0; i < AESKEY; i++ {\n\t\tK1[i] = K[i]\n\t\tK2[i] = K[AESKEY+i]\n\t}\n\n\tC := core.AES_CBC_IV0_ENCRYPT(K1[:], M)\n\n\tL2 := core.InttoBytes(len(P2), 8)\n\n\tvar AC []byte\n\n\tfor i := 0; i < len(C); i++ {\n\t\tAC = append(AC, C[i])\n\t}\n\tfor i := 0; i < len(P2); i++ {\n\t\tAC = append(AC, P2[i])\n\t}\n\tfor i := 0; i < 8; i++ {\n\t\tAC = append(AC, L2[i])\n\t}\n\n\tcore.HMAC(core.MC_SHA2, sha, T, len(T), K2[:], AC)\n\n\treturn C\n}",
"func VCVTTPS2DQ_SAE_Z(z, k, z1 operand.Op) { ctx.VCVTTPS2DQ_SAE_Z(z, k, z1) }",
"func Dlaed6(kniter int, orgati bool, rho float64, d, z *mat.Vector, finit float64) (tau float64, info int) {\n\tvar scale bool\n\tvar a, b, base, c, ddf, df, eight, eps, erretm, eta, f, fc, four, lbd, one, sclfac, sclinv, small1, small2, sminv1, sminv2, temp, temp1, temp2, temp3, temp4, three, two, ubd, zero float64\n\tvar i, iter, maxit, niter int\n\tdscale := vf(3)\n\tzscale := vf(3)\n\n\tmaxit = 40\n\tzero = 0.0\n\tone = 1.0\n\ttwo = 2.0\n\tthree = 3.0\n\tfour = 4.0\n\teight = 8.0\n\n\tif orgati {\n\t\tlbd = d.Get(1)\n\t\tubd = d.Get(2)\n\t} else {\n\t\tlbd = d.Get(0)\n\t\tubd = d.Get(1)\n\t}\n\tif finit < zero {\n\t\tlbd = zero\n\t} else {\n\t\tubd = zero\n\t}\n\n\tniter = 1\n\ttau = zero\n\tif kniter == 2 {\n\t\tif orgati {\n\t\t\ttemp = (d.Get(2) - d.Get(1)) / two\n\t\t\tc = rho + z.Get(0)/((d.Get(0)-d.Get(1))-temp)\n\t\t\ta = c*(d.Get(1)+d.Get(2)) + z.Get(1) + z.Get(2)\n\t\t\tb = c*d.Get(1)*d.Get(2) + z.Get(1)*d.Get(2) + z.Get(2)*d.Get(1)\n\t\t} else {\n\t\t\ttemp = (d.Get(0) - d.Get(1)) / two\n\t\t\tc = rho + z.Get(2)/((d.Get(2)-d.Get(1))-temp)\n\t\t\ta = c*(d.Get(0)+d.Get(1)) + z.Get(0) + z.Get(1)\n\t\t\tb = c*d.Get(0)*d.Get(1) + z.Get(0)*d.Get(1) + z.Get(1)*d.Get(0)\n\t\t}\n\t\ttemp = math.Max(math.Abs(a), math.Max(math.Abs(b), math.Abs(c)))\n\t\ta = a / temp\n\t\tb = b / temp\n\t\tc = c / temp\n\t\tif c == zero {\n\t\t\ttau = b / a\n\t\t} else if a <= zero {\n\t\t\ttau = (a - math.Sqrt(math.Abs(a*a-four*b*c))) / (two * c)\n\t\t} else {\n\t\t\ttau = two * b / (a + math.Sqrt(math.Abs(a*a-four*b*c)))\n\t\t}\n\t\tif tau < lbd || tau > ubd {\n\t\t\ttau = (lbd + ubd) / two\n\t\t}\n\t\tif d.Get(0) == tau || d.Get(1) == tau || d.Get(2) == tau {\n\t\t\ttau = zero\n\t\t} else {\n\t\t\ttemp = finit + tau*z.Get(0)/(d.Get(0)*(d.Get(0)-tau)) + tau*z.Get(1)/(d.Get(1)*(d.Get(1)-tau)) + tau*z.Get(2)/(d.Get(2)*(d.Get(2)-tau))\n\t\t\tif temp <= zero {\n\t\t\t\tlbd = tau\n\t\t\t} else {\n\t\t\t\tubd = tau\n\t\t\t}\n\t\t\tif math.Abs(finit) <= math.Abs(temp) {\n\t\t\t\ttau = zero\n\t\t\t}\n\t\t}\n\t}\n\n\t// get machine parameters for possible scaling to avoid overflow\n\t//\n\t// modified by Sven: parameters SMALL1, SMINV1, SMALL2,\n\t// SMINV2, EPS are not SAVEd anymore between one call to the\n\t// others but recomputed at each call\n\teps = Dlamch(Epsilon)\n\tbase = Dlamch(Base)\n\tsmall1 = math.Pow(base, float64(int(math.Log(Dlamch(SafeMinimum))/math.Log(base)/three)))\n\tsminv1 = one / small1\n\tsmall2 = small1 * small1\n\tsminv2 = sminv1 * sminv1\n\n\t// Determine if scaling of inputs necessary to avoid overflow\n\t// when computing 1/TEMP**3\n\tif orgati {\n\t\ttemp = math.Min(math.Abs(d.Get(1)-tau), math.Abs(d.Get(2)-tau))\n\t} else {\n\t\ttemp = math.Min(math.Abs(d.Get(0)-tau), math.Abs(d.Get(1)-tau))\n\t}\n\tscale = false\n\tif temp <= small1 {\n\t\tscale = true\n\t\tif temp <= small2 {\n\t\t\t// Scale up by power of radix nearest 1/SAFMIN**(2/3)\n\t\t\tsclfac = sminv2\n\t\t\tsclinv = small2\n\t\t} else {\n\t\t\t// Scale up by power of radix nearest 1/SAFMIN**(1/3)\n\t\t\tsclfac = sminv1\n\t\t\tsclinv = small1\n\t\t}\n\n\t\t// Scaling up safe because D, Z, TAU scaled elsewhere to be O(1)\n\t\tfor i = 1; i <= 3; i++ {\n\t\t\tdscale.Set(i-1, d.Get(i-1)*sclfac)\n\t\t\tzscale.Set(i-1, z.Get(i-1)*sclfac)\n\t\t}\n\t\ttau = tau * sclfac\n\t\tlbd = lbd * sclfac\n\t\tubd = ubd * sclfac\n\t} else {\n\t\t// Copy D and Z to DSCALE and ZSCALE\n\t\tfor i = 1; i <= 3; i++ {\n\t\t\tdscale.Set(i-1, d.Get(i-1))\n\t\t\tzscale.Set(i-1, z.Get(i-1))\n\t\t}\n\t}\n\n\tfc = zero\n\tdf = zero\n\tddf = zero\n\tfor i = 1; i <= 3; i++ {\n\t\ttemp = one / (dscale.Get(i-1) - tau)\n\t\ttemp1 = zscale.Get(i-1) * temp\n\t\ttemp2 = temp1 * temp\n\t\ttemp3 = temp2 * temp\n\t\tfc = fc + temp1/dscale.Get(i-1)\n\t\tdf = df + temp2\n\t\tddf = ddf + temp3\n\t}\n\tf = finit + tau*fc\n\n\tif math.Abs(f) <= zero {\n\t\tgoto label60\n\t}\n\tif f <= zero {\n\t\tlbd = tau\n\t} else {\n\t\tubd = tau\n\t}\n\n\t// Iteration begins -- Use Gragg-Thornton-Warner cubic convergent\n\t// scheme\n\t//\n\t// It is not hard to see that\n\t//\n\t// 1) Iterations will go up monotonically\n\t// if FINIT < 0;\n\t//\n\t// 2) Iterations will go down monotonically\n\t// if FINIT > 0.\n\titer = niter + 1\n\n\tfor niter = iter; niter <= maxit; niter++ {\n\n\t\tif orgati {\n\t\t\ttemp1 = dscale.Get(1) - tau\n\t\t\ttemp2 = dscale.Get(2) - tau\n\t\t} else {\n\t\t\ttemp1 = dscale.Get(0) - tau\n\t\t\ttemp2 = dscale.Get(1) - tau\n\t\t}\n\t\ta = (temp1+temp2)*f - temp1*temp2*df\n\t\tb = temp1 * temp2 * f\n\t\tc = f - (temp1+temp2)*df + temp1*temp2*ddf\n\t\ttemp = math.Max(math.Abs(a), math.Max(math.Abs(b), math.Abs(c)))\n\t\ta = a / temp\n\t\tb = b / temp\n\t\tc = c / temp\n\t\tif c == zero {\n\t\t\teta = b / a\n\t\t} else if a <= zero {\n\t\t\teta = (a - math.Sqrt(math.Abs(a*a-four*b*c))) / (two * c)\n\t\t} else {\n\t\t\teta = two * b / (a + math.Sqrt(math.Abs(a*a-four*b*c)))\n\t\t}\n\t\tif f*eta >= zero {\n\t\t\teta = -f / df\n\t\t}\n\n\t\ttau = tau + eta\n\t\tif tau < lbd || tau > ubd {\n\t\t\ttau = (lbd + ubd) / two\n\t\t}\n\n\t\tfc = zero\n\t\terretm = zero\n\t\tdf = zero\n\t\tddf = zero\n\t\tfor i = 1; i <= 3; i++ {\n\t\t\tif (dscale.Get(i-1) - tau) != zero {\n\t\t\t\ttemp = one / (dscale.Get(i-1) - tau)\n\t\t\t\ttemp1 = zscale.Get(i-1) * temp\n\t\t\t\ttemp2 = temp1 * temp\n\t\t\t\ttemp3 = temp2 * temp\n\t\t\t\ttemp4 = temp1 / dscale.Get(i-1)\n\t\t\t\tfc = fc + temp4\n\t\t\t\terretm = erretm + math.Abs(temp4)\n\t\t\t\tdf = df + temp2\n\t\t\t\tddf = ddf + temp3\n\t\t\t} else {\n\t\t\t\tgoto label60\n\t\t\t}\n\t\t}\n\t\tf = finit + tau*fc\n\t\terretm = eight*(math.Abs(finit)+math.Abs(tau)*erretm) + math.Abs(tau)*df\n\t\tif (math.Abs(f) <= four*eps*erretm) || ((ubd - lbd) <= four*eps*math.Abs(tau)) {\n\t\t\tgoto label60\n\t\t}\n\t\tif f <= zero {\n\t\t\tlbd = tau\n\t\t} else {\n\t\t\tubd = tau\n\t\t}\n\t}\n\tinfo = 1\nlabel60:\n\t;\n\n\t// Undo scaling\n\tif scale {\n\t\ttau = tau * sclinv\n\t}\n\n\treturn\n}",
"func det(sqMtx [][]float64) float64 {\n\tif len(sqMtx) == 2 {\n\t\tm00 := sqMtx[0][0]\n\t\tm01 := sqMtx[0][1]\n\t\tm10 := sqMtx[1][0]\n\t\tm11 := sqMtx[1][1]\n\t\treturn m00*m11 - m10*m01\n\t}\n\tvar res, sgn float64 = 0, 1\n\tfor j := range sqMtx {\n\t\tres += sgn * sqMtx[0][j] * det(minor(sqMtx, j))\n\t\tsgn *= -1\n\t}\n\treturn res\n}",
"func VCVTTPD2DQ_SAE_Z(z, k, y operand.Op) { ctx.VCVTTPD2DQ_SAE_Z(z, k, y) }",
"func Energy(foldList, seq []string) int {\n\n\tseqMat := DrawFold(foldList, seq)\n\t//loop over all squares,calculate the sum of p*s\n\t//we only consider \"H\" since pi=0 for \"P\"\n\tvar sum int\n\tfor i := 2; i < len(seqMat); i++ {\n\t\tfor j := 2; j < len(seqMat); j++ {\n\t\t\t//only consider \"H\"\n\t\t\tif seqMat[i][j] == \"H\" {\n\t\t\t\t//adjacent square has amino acid and not connected\n\t\t\t\tif (seqMat[i-2][j] == \"H\" || seqMat[i-2][j] == \"P\") && seqMat[i-1][j] != \"-\" {\n\t\t\t\t\tsum += 1\n\t\t\t\t}\n\t\t\t\tif (seqMat[i+2][j] == \"H\" || seqMat[i+2][j] == \"P\") && seqMat[i+1][j] != \"-\" {\n\t\t\t\t\tsum += 1\n\t\t\t\t}\n\t\t\t\tif (seqMat[i][j-2] == \"H\" || seqMat[i][j-2] == \"P\") && seqMat[i][j-1] != \"-\" {\n\t\t\t\t\tsum += 1\n\t\t\t\t}\n\t\t\t\tif (seqMat[i][j+2] == \"H\" || seqMat[i][j+2] == \"P\") && seqMat[i][j+1] != \"-\" {\n\t\t\t\t\tsum += 1\n\t\t\t\t}\n\t\t\t\tif seqMat[i-2][j-2] == \"H\" || seqMat[i-2][j-2] == \"P\" { //diagonal elements won't be connected\n\t\t\t\t\tsum += 1\n\t\t\t\t}\n\t\t\t\tif seqMat[i+2][j+2] == \"H\" || seqMat[i+2][j+2] == \"P\" {\n\t\t\t\t\tsum += 1\n\t\t\t\t}\n\t\t\t\tif seqMat[i-2][j+2] == \"H\" || seqMat[i-2][j+2] == \"P\" {\n\t\t\t\t\tsum += 1\n\t\t\t\t}\n\t\t\t\tif seqMat[i+2][j-2] == \"H\" || seqMat[i+2][j-2] == \"P\" {\n\t\t\t\t\tsum += 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn sum\n}",
"func (t *TransportTable) isDegeneracySolution() bool {\n\tvar counter int\n\tfor _, mx := range t.matrix {\n\t\tfor _, v := range mx {\n\t\t\tif v != shipZero {\n\t\t\t\tcounter++\n\t\t\t}\n\t\t}\n\t}\n\tif t.demandLen+t.supplyLen-1 > counter {\n\t\treturn true\n\t}\n\treturn false\n}",
"func TestAttestSigner_SigUtils(t *testing.T) {\n\tsig1 := []byte{71, 48, 68, 2, 32, 100, 88, 73, 1, 86, 42, 210, 239, 196, 136, 107, 0, 178, 223, 59, 32, 235, 58, 231, 207, 168, 87, 95, 227, 83, 207, 67, 150, 254, 26, 99, 13, 2, 32, 0, 169, 167, 160, 35, 235, 221, 136, 214, 217, 143, 64, 105, 250, 180, 188, 109, 236, 175, 117, 198, 53, 180, 24, 223, 217, 44, 199, 54, 158, 230, 227, 1}\n\tsig2 := []byte{71, 48, 68, 2, 32, 17, 175, 6, 205, 216, 180, 188, 216, 38, 178, 109, 17, 145, 237, 148, 1, 30, 73, 161, 54, 176, 122, 66, 6, 211, 219, 90, 216, 219, 38, 162, 137, 2, 32, 14, 61, 139, 90, 233, 169, 9, 57, 249, 101, 38, 109, 147, 244, 151, 182, 93, 136, 64, 221, 158, 172, 238, 208, 71, 106, 39, 50, 194, 185, 230, 102, 1}\n\tsig3 := []byte{71, 48, 68, 2, 32, 17, 175, 6, 205, 216, 180, 188, 216, 38, 178, 109, 17, 145, 237, 148, 1, 30, 73, 161, 54, 176, 122, 66, 6, 211, 219, 90, 216, 219, 38, 162, 137, 2, 32, 14, 61, 139, 90, 233, 169, 9, 57, 249, 101, 38, 109, 145, 244, 151, 182, 93, 136, 64, 221, 158, 172, 238, 208, 71, 106, 39, 50, 194, 185, 230, 102, 1}\n\n\tvar msgA []byte\n\tvar msgB []byte\n\tvar splitMsgA [][]byte\n\tvar splitMsgB [][]byte\n\tvar msgs [][][]byte\n\tvar sigs [][]crypto.Sig\n\n\tnumOfTxInputs := 0\n\n\t// test 1 message 0 signature\n\tsplitMsgA = UnserializeBytes(msgA)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgA, numOfTxInputs)\n\tassert.Equal(t, 0, numOfTxInputs)\n\tassert.Equal(t, [][]byte{}, splitMsgA)\n\tassert.Equal(t, 0, len(splitMsgA))\n\n\tmsgs = [][][]byte{[][]byte{}}\n\tsigs = getSigsFromMsgs(msgs, numOfTxInputs)\n\tassert.Equal(t, [][]crypto.Sig{}, sigs)\n\n\t// test 2 messages 0 signature\n\tsplitMsgA = UnserializeBytes(msgA)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgA, numOfTxInputs)\n\tassert.Equal(t, 0, numOfTxInputs)\n\tsplitMsgB = UnserializeBytes(msgB)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgB, numOfTxInputs)\n\tassert.Equal(t, 0, numOfTxInputs)\n\tassert.Equal(t, [][]byte{}, splitMsgA)\n\tassert.Equal(t, [][]byte{}, splitMsgB)\n\tassert.Equal(t, 0, len(splitMsgA))\n\tassert.Equal(t, 0, len(splitMsgB))\n\n\tmsgs = [][][]byte{[][]byte{}, [][]byte{}}\n\tsigs = getSigsFromMsgs(msgs, numOfTxInputs)\n\tassert.Equal(t, [][]crypto.Sig{}, sigs)\n\n\t// test 1 message 1 signature\n\tnumOfTxInputs = 0\n\tmsgA = sig1\n\n\tsplitMsgA = UnserializeBytes(msgA)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgA, numOfTxInputs)\n\tassert.Equal(t, 1, numOfTxInputs)\n\tassert.Equal(t, [][]byte{sig1[1:]}, splitMsgA)\n\tassert.Equal(t, 1, len(splitMsgA))\n\n\tmsgs = [][][]byte{splitMsgA}\n\tsigs = getSigsFromMsgs(msgs, numOfTxInputs)\n\tassert.Equal(t, [][]crypto.Sig{\n\t\t[]crypto.Sig{crypto.Sig(sig1[1:])}}, sigs)\n\n\t// test 1 message 2 signature\n\tnumOfTxInputs = 0\n\tmsgA = sig1\n\tmsgA = append(msgA, sig2...)\n\n\tsplitMsgA = UnserializeBytes(msgA)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgA, numOfTxInputs)\n\tassert.Equal(t, 2, numOfTxInputs)\n\tassert.Equal(t, [][]byte{sig1[1:], sig2[1:]}, splitMsgA)\n\tassert.Equal(t, 2, len(splitMsgA))\n\n\tmsgs = [][][]byte{splitMsgA}\n\tsigs = getSigsFromMsgs(msgs, numOfTxInputs)\n\tassert.Equal(t, [][]crypto.Sig{\n\t\t[]crypto.Sig{crypto.Sig(sig1[1:])},\n\t\t[]crypto.Sig{crypto.Sig(sig2[1:])}}, sigs)\n\n\t// test 2 messages 1 signature\n\tnumOfTxInputs = 0\n\tmsgA = sig1\n\tmsgB = sig3\n\n\tsplitMsgA = UnserializeBytes(msgA)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgA, numOfTxInputs)\n\tassert.Equal(t, 1, numOfTxInputs)\n\tsplitMsgB = UnserializeBytes(msgB)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgB, numOfTxInputs)\n\tassert.Equal(t, 1, numOfTxInputs)\n\tassert.Equal(t, [][]byte{sig1[1:]}, splitMsgA)\n\tassert.Equal(t, [][]byte{sig3[1:]}, splitMsgB)\n\tassert.Equal(t, 1, len(splitMsgA))\n\tassert.Equal(t, 1, len(splitMsgB))\n\n\tmsgs = [][][]byte{splitMsgA, splitMsgB}\n\tsigs = getSigsFromMsgs(msgs, numOfTxInputs)\n\tassert.Equal(t, [][]crypto.Sig{\n\t\t[]crypto.Sig{crypto.Sig(sig1[1:]), crypto.Sig(sig3[1:])}}, sigs)\n\n\t// test 2 messages 2 signatures\n\tnumOfTxInputs = 0\n\tmsgA = sig1\n\tmsgA = append(msgA, sig2...)\n\tmsgB = sig3\n\tmsgB = append(msgB, sig3...)\n\n\tsplitMsgA = UnserializeBytes(msgA)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgA, numOfTxInputs)\n\tassert.Equal(t, 2, numOfTxInputs)\n\tsplitMsgB = UnserializeBytes(msgB)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgB, numOfTxInputs)\n\tassert.Equal(t, 2, numOfTxInputs)\n\tassert.Equal(t, [][]byte{sig1[1:], sig2[1:]}, splitMsgA)\n\tassert.Equal(t, [][]byte{sig3[1:], sig3[1:]}, splitMsgB)\n\tassert.Equal(t, 2, len(splitMsgA))\n\tassert.Equal(t, 2, len(splitMsgB))\n\n\tmsgs = [][][]byte{splitMsgA, splitMsgB}\n\tsigs = getSigsFromMsgs(msgs, numOfTxInputs)\n\tassert.Equal(t, [][]crypto.Sig{\n\t\t[]crypto.Sig{crypto.Sig(sig1[1:]), crypto.Sig(sig3[1:])},\n\t\t[]crypto.Sig{crypto.Sig(sig2[1:]), crypto.Sig(sig3[1:])}}, sigs)\n\n\t// test 2 messages 0,2 signatures\n\tnumOfTxInputs = 0\n\tmsgA = []byte{}\n\tmsgB = sig3\n\tmsgB = append(msgB, sig3...)\n\n\tsplitMsgA = UnserializeBytes(msgA)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgA, numOfTxInputs)\n\tassert.Equal(t, 0, numOfTxInputs)\n\tsplitMsgB = UnserializeBytes(msgB)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgB, numOfTxInputs)\n\tassert.Equal(t, 2, numOfTxInputs)\n\tassert.Equal(t, [][]byte{}, splitMsgA)\n\tassert.Equal(t, [][]byte{sig3[1:], sig3[1:]}, splitMsgB)\n\tassert.Equal(t, 0, len(splitMsgA))\n\tassert.Equal(t, 2, len(splitMsgB))\n\n\tmsgs = [][][]byte{splitMsgA, splitMsgB}\n\tsigs = getSigsFromMsgs(msgs, numOfTxInputs)\n\tassert.Equal(t, [][]crypto.Sig{\n\t\t[]crypto.Sig{crypto.Sig(sig3[1:])},\n\t\t[]crypto.Sig{crypto.Sig(sig3[1:])}}, sigs)\n\n\t// test 2 messages 2,0 signatures\n\tnumOfTxInputs = 0\n\tmsgA = sig1\n\tmsgA = append(msgA, sig2...)\n\tmsgB = []byte{}\n\n\tsplitMsgA = UnserializeBytes(msgA)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgA, numOfTxInputs)\n\tassert.Equal(t, 2, numOfTxInputs)\n\tsplitMsgB = UnserializeBytes(msgB)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgB, numOfTxInputs)\n\tassert.Equal(t, 2, numOfTxInputs)\n\tassert.Equal(t, [][]byte{sig1[1:], sig2[1:]}, splitMsgA)\n\tassert.Equal(t, [][]byte{}, splitMsgB)\n\tassert.Equal(t, 2, len(splitMsgA))\n\tassert.Equal(t, 0, len(splitMsgB))\n\n\tmsgs = [][][]byte{splitMsgA, splitMsgB}\n\tsigs = getSigsFromMsgs(msgs, numOfTxInputs)\n\tassert.Equal(t, [][]crypto.Sig{\n\t\t[]crypto.Sig{crypto.Sig(sig1[1:])},\n\t\t[]crypto.Sig{crypto.Sig(sig2[1:])}}, sigs)\n\n\t// test 2 messages 1,2 signatures\n\tnumOfTxInputs = 0\n\tmsgA = sig1\n\tmsgB = sig3\n\tmsgB = append(msgB, sig3...)\n\n\tsplitMsgA = UnserializeBytes(msgA)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgA, numOfTxInputs)\n\tassert.Equal(t, 1, numOfTxInputs)\n\tsplitMsgB = UnserializeBytes(msgB)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgB, numOfTxInputs)\n\tassert.Equal(t, 2, numOfTxInputs)\n\tassert.Equal(t, [][]byte{sig1[1:]}, splitMsgA)\n\tassert.Equal(t, [][]byte{sig3[1:], sig3[1:]}, splitMsgB)\n\tassert.Equal(t, 1, len(splitMsgA))\n\tassert.Equal(t, 2, len(splitMsgB))\n\n\tmsgs = [][][]byte{splitMsgA, splitMsgB}\n\tsigs = getSigsFromMsgs(msgs, numOfTxInputs)\n\tassert.Equal(t, [][]crypto.Sig{\n\t\t[]crypto.Sig{crypto.Sig(sig1[1:]), crypto.Sig(sig3[1:])},\n\t\t[]crypto.Sig{crypto.Sig(sig3[1:])}}, sigs)\n\n\t// test 2 messages 2,1 signatures\n\tnumOfTxInputs = 0\n\tmsgA = sig1\n\tmsgA = append(msgA, sig2...)\n\tmsgB = sig3\n\n\tsplitMsgA = UnserializeBytes(msgA)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgA, numOfTxInputs)\n\tassert.Equal(t, 2, numOfTxInputs)\n\tsplitMsgB = UnserializeBytes(msgB)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgB, numOfTxInputs)\n\tassert.Equal(t, 2, numOfTxInputs)\n\tassert.Equal(t, [][]byte{sig1[1:], sig2[1:]}, splitMsgA)\n\tassert.Equal(t, [][]byte{sig3[1:]}, splitMsgB)\n\tassert.Equal(t, 2, len(splitMsgA))\n\tassert.Equal(t, 1, len(splitMsgB))\n\n\tmsgs = [][][]byte{splitMsgA, splitMsgB}\n\tsigs = getSigsFromMsgs(msgs, numOfTxInputs)\n\tassert.Equal(t, [][]crypto.Sig{\n\t\t[]crypto.Sig{crypto.Sig(sig1[1:]), crypto.Sig(sig3[1:])},\n\t\t[]crypto.Sig{crypto.Sig(sig2[1:])}}, sigs)\n\n\t// test 2 messages 1,0 signatures\n\tnumOfTxInputs = 0\n\tmsgA = sig1\n\tmsgB = []byte{}\n\n\tsplitMsgA = UnserializeBytes(msgA)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgA, numOfTxInputs)\n\tassert.Equal(t, 1, numOfTxInputs)\n\tsplitMsgB = UnserializeBytes(msgB)\n\tnumOfTxInputs = updateNumOfTxInputs(splitMsgB, numOfTxInputs)\n\tassert.Equal(t, 1, numOfTxInputs)\n\tassert.Equal(t, [][]byte{sig1[1:]}, splitMsgA)\n\tassert.Equal(t, [][]byte{}, splitMsgB)\n\tassert.Equal(t, 1, len(splitMsgA))\n\tassert.Equal(t, 0, len(splitMsgB))\n\n\tmsgs = [][][]byte{splitMsgA, splitMsgB}\n\tsigs = getSigsFromMsgs(msgs, numOfTxInputs)\n\tassert.Equal(t, [][]crypto.Sig{\n\t\t[]crypto.Sig{crypto.Sig(sig1[1:])}}, sigs)\n}",
"func (s SE) Der(exp, act mat.Matrix) mat.Matrix {\n\tdiff := mat.Sub(act, exp)\n\tdiff.Scale(2)\n\treturn diff\n}",
"func (mutant *mutant) runDiagonalSearch() {\n\n\tn := len(mutant.Adn)\n\tfor i := 0; i < n-SIZE_SUBSEQUENCE+1; i++ { // horizontal / vertical movs\n\n\t\tif mutant.counter >= MAX_SUBSEQUENCES {\n\t\t\treturn\n\t\t}\n\t\twg := sync.WaitGroup{}\n\t\twg.Add(2)\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\tfor j := 0; j < n-SIZE_SUBSEQUENCE+1; j++ { // horizontal movs\n\t\t\t\tif mutant.counter >= MAX_SUBSEQUENCES {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tseq := mutant.getDiagonalFrom(i, j)\n\t\t\t\tlastIndex := mutant.verifySequence(seq)\n\t\t\t\tj += 1 + lastIndex\n\n\t\t\t}\n\t\t}()\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\n\t\t\tfor j := 0; j < n-SIZE_SUBSEQUENCE; { // vertical movs\n\t\t\t\tif mutant.counter >= MAX_SUBSEQUENCES {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tseq := mutant.getDiagonalFrom(j+1, i) //prevent repeat first diagonal with j+1\n\t\t\t\tlastIndex := mutant.verifySequence(seq)\n\t\t\t\tj += 1 + lastIndex\n\n\t\t\t}\n\t\t}()\n\t\twg.Wait()\n\n\t}\n}",
"func Zgges3(jobvsl, jobvsr, sort byte, selctg func(complex128, complex128) bool, n int, a, b *mat.CMatrix, alpha, beta *mat.CVector, vsl, vsr *mat.CMatrix, work *mat.CVector, lwork int, rwork *mat.Vector, bwork *[]bool) (sdim, info int, err error) {\n\tvar cursl, ilascl, ilbscl, ilvsl, ilvsr, lastsl, lquery, wantst bool\n\tvar cone, czero complex128\n\tvar anrm, anrmto, bignum, bnrm, bnrmto, eps, one, smlnum, zero float64\n\tvar i, icols, ierr, ihi, ijobvl, ijobvr, ileft, ilo, iright, irows, irwrk, itau, iwrk, lwkopt int\n\n\tdif := vf(2)\n\tidum := make([]int, 1)\n\n\tzero = 0.0\n\tone = 1.0\n\tczero = (0.0 + 0.0*1i)\n\tcone = (1.0 + 0.0*1i)\n\n\t// Decode the input arguments\n\tif jobvsl == 'N' {\n\t\tijobvl = 1\n\t\tilvsl = false\n\t} else if jobvsl == 'V' {\n\t\tijobvl = 2\n\t\tilvsl = true\n\t} else {\n\t\tijobvl = -1\n\t\tilvsl = false\n\t}\n\n\tif jobvsr == 'N' {\n\t\tijobvr = 1\n\t\tilvsr = false\n\t} else if jobvsr == 'V' {\n\t\tijobvr = 2\n\t\tilvsr = true\n\t} else {\n\t\tijobvr = -1\n\t\tilvsr = false\n\t}\n\n\twantst = sort == 'S'\n\n\t// Test the input arguments\n\tlquery = (lwork == -1)\n\tif ijobvl <= 0 {\n\t\terr = fmt.Errorf(\"ijobvl <= 0: jobvsl='%c'\", jobvsl)\n\t} else if ijobvr <= 0 {\n\t\terr = fmt.Errorf(\"ijobvr <= 0: jobvsr='%c'\", jobvsr)\n\t} else if (!wantst) && (sort != 'N') {\n\t\terr = fmt.Errorf(\"(!wantst) && (sort != 'N'): sort='%c'\", sort)\n\t} else if n < 0 {\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if a.Rows < max(1, n) {\n\t\terr = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=%v, n=%v\", a.Rows, n)\n\t} else if b.Rows < max(1, n) {\n\t\terr = fmt.Errorf(\"b.Rows < max(1, n): b.Rows=%v, n=%v\", b.Rows, n)\n\t} else if vsl.Rows < 1 || (ilvsl && vsl.Rows < n) {\n\t\terr = fmt.Errorf(\"vsl.Rows < 1 || (ilvsl && vsl.Rows < n): vsl.Rows=%v, n=%v, ilvsl=%v\", vsl.Rows, n, ilvsl)\n\t} else if vsr.Rows < 1 || (ilvsr && vsr.Rows < n) {\n\t\terr = fmt.Errorf(\"vsr.Rows < 1 || (ilvsr && vsr.Rows < n): vsr.Rows=%v, n=%v, ilvsr=%v\", vsr.Rows, n, ilvsr)\n\t} else if lwork < max(1, 2*n) && !lquery {\n\t\terr = fmt.Errorf(\"lwork < max(1, 2*n) && !lquery: lwork=%v, n=%v, lquery=%v\", lwork, n, lquery)\n\t}\n\n\t// Compute workspace\n\tif err == nil {\n\t\tif err = Zgeqrf(n, n, b, work, work, -1); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tlwkopt = max(1, n+int(work.GetRe(0)))\n\t\tif err = Zunmqr(Left, ConjTrans, n, n, n, b, work, a, work, -1); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tlwkopt = max(lwkopt, n+int(work.GetRe(0)))\n\t\tif ilvsl {\n\t\t\tif err = Zungqr(n, n, n, vsl, work, work, -1); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tlwkopt = max(lwkopt, n+int(work.GetRe(0)))\n\t\t}\n\t\tif err = Zgghd3(jobvsl, jobvsr, n, 1, n, a, b, vsl, vsr, work, -1); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tlwkopt = max(lwkopt, n+int(work.GetRe(0)))\n\t\tif ierr, err = Zhgeqz('S', jobvsl, jobvsr, n, 1, n, a, b, alpha, beta, vsl, vsr, work, -1, rwork); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tlwkopt = max(lwkopt, int(work.GetRe(0)))\n\t\tif wantst {\n\t\t\tif sdim, _, _, ierr, err = Ztgsen(0, ilvsl, ilvsr, *bwork, n, a, b, alpha, beta, vsl, vsr, dif, work, -1, &idum, 1); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tlwkopt = max(lwkopt, int(work.GetRe(0)))\n\t\t}\n\t\twork.SetRe(0, float64(lwkopt))\n\t}\n\n\tif err != nil {\n\t\tgltest.Xerbla2(\"Zgges3\", err)\n\t\treturn\n\t} else if lquery {\n\t\treturn\n\t}\n\n\t// Quick return if possible\n\tif n == 0 {\n\t\tsdim = 0\n\t\treturn\n\t}\n\n\t// Get machine constants\n\teps = Dlamch(Precision)\n\tsmlnum = Dlamch(SafeMinimum)\n\tbignum = one / smlnum\n\tsmlnum, bignum = Dlabad(smlnum, bignum)\n\tsmlnum = math.Sqrt(smlnum) / eps\n\tbignum = one / smlnum\n\n\t// Scale A if max element outside range [SMLNUM,BIGNUM]\n\tanrm = Zlange('M', n, n, a, rwork)\n\tilascl = false\n\tif anrm > zero && anrm < smlnum {\n\t\tanrmto = smlnum\n\t\tilascl = true\n\t} else if anrm > bignum {\n\t\tanrmto = bignum\n\t\tilascl = true\n\t}\n\n\tif ilascl {\n\t\tif err = Zlascl('G', 0, 0, anrm, anrmto, n, n, a); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\n\t// Scale B if max element outside range [SMLNUM,BIGNUM]\n\tbnrm = Zlange('M', n, n, b, rwork)\n\tilbscl = false\n\tif bnrm > zero && bnrm < smlnum {\n\t\tbnrmto = smlnum\n\t\tilbscl = true\n\t} else if bnrm > bignum {\n\t\tbnrmto = bignum\n\t\tilbscl = true\n\t}\n\n\tif ilbscl {\n\t\tif err = Zlascl('G', 0, 0, bnrm, bnrmto, n, n, b); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\n\t// Permute the matrix to make it more nearly triangular\n\tileft = 1\n\tiright = n + 1\n\tirwrk = iright + n\n\tif ilo, ihi, err = Zggbal('P', n, a, b, rwork.Off(ileft-1), rwork.Off(iright-1), rwork.Off(irwrk-1)); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Reduce B to triangular form (QR decomposition of B)\n\tirows = ihi + 1 - ilo\n\ticols = n + 1 - ilo\n\titau = 1\n\tiwrk = itau + irows\n\tif err = Zgeqrf(irows, icols, b.Off(ilo-1, ilo-1), work.Off(itau-1), work.Off(iwrk-1), lwork+1-iwrk); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Apply the orthogonal transformation to matrix A\n\tif err = Zunmqr(Left, ConjTrans, irows, icols, irows, b.Off(ilo-1, ilo-1), work.Off(itau-1), a.Off(ilo-1, ilo-1), work.Off(iwrk-1), lwork+1-iwrk); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Initialize VSL\n\tif ilvsl {\n\t\tZlaset(Full, n, n, czero, cone, vsl)\n\t\tif irows > 1 {\n\t\t\tZlacpy(Lower, irows-1, irows-1, b.Off(ilo, ilo-1), vsl.Off(ilo, ilo-1))\n\t\t}\n\t\tif err = Zungqr(irows, irows, irows, vsl.Off(ilo-1, ilo-1), work.Off(itau-1), work.Off(iwrk-1), lwork+1-iwrk); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\n\t// Initialize VSR\n\tif ilvsr {\n\t\tZlaset(Full, n, n, czero, cone, vsr)\n\t}\n\n\t// Reduce to generalized Hessenberg form\n\tif err = Zgghd3(jobvsl, jobvsr, n, ilo, ihi, a, b, vsl, vsr, work.Off(iwrk-1), lwork+1-iwrk); err != nil {\n\t\tpanic(err)\n\t}\n\n\tsdim = 0\n\n\t// Perform QZ algorithm, computing Schur vectors if desired\n\tiwrk = itau\n\tif ierr, err = Zhgeqz('S', jobvsl, jobvsr, n, ilo, ihi, a, b, alpha, beta, vsl, vsr, work.Off(iwrk-1), lwork+1-iwrk, rwork.Off(irwrk-1)); err != nil {\n\t\tpanic(err)\n\t}\n\tif ierr != 0 {\n\t\tif ierr > 0 && ierr <= n {\n\t\t\tinfo = ierr\n\t\t} else if ierr > n && ierr <= 2*n {\n\t\t\tinfo = ierr - n\n\t\t} else {\n\t\t\tinfo = n + 1\n\t\t}\n\t\tgoto label30\n\t}\n\n\t// Sort eigenvalues ALPHA/BETA if desired\n\tif wantst {\n\t\t// Undo scaling on eigenvalues before selecting\n\t\tif ilascl {\n\t\t\tif err = Zlascl('G', 0, 0, anrm, anrmto, n, 1, alpha.CMatrix(n, opts)); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t\tif ilbscl {\n\t\t\tif err = Zlascl('G', 0, 0, bnrm, bnrmto, n, 1, beta.CMatrix(n, opts)); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\n\t\t// Select eigenvalues\n\t\tfor i = 1; i <= n; i++ {\n\t\t\t(*bwork)[i-1] = selctg(alpha.Get(i-1), beta.Get(i-1))\n\t\t}\n\n\t\tif sdim, _, _, ierr, err = Ztgsen(0, ilvsl, ilvsr, *bwork, n, a, b, alpha, beta, vsl, vsr, dif, work.Off(iwrk-1), lwork-iwrk+1, &idum, 1); err != nil || ierr == 1 {\n\t\t\tinfo = n + 3\n\t\t}\n\n\t}\n\n\t// Apply back-permutation to VSL and VSR\n\tif ilvsl {\n\t\tif err = Zggbak('P', Left, n, ilo, ihi, rwork.Off(ileft-1), rwork.Off(iright-1), n, vsl); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\tif ilvsr {\n\t\tif err = Zggbak('P', Right, n, ilo, ihi, rwork.Off(ileft-1), rwork.Off(iright-1), n, vsr); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\n\t// Undo scaling\n\tif ilascl {\n\t\tif err = Zlascl('U', 0, 0, anrmto, anrm, n, n, a); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif err = Zlascl('G', 0, 0, anrmto, anrm, n, 1, alpha.CMatrix(n, opts)); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\n\tif ilbscl {\n\t\tif err = Zlascl('U', 0, 0, bnrmto, bnrm, n, n, b); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif err = Zlascl('G', 0, 0, bnrmto, bnrm, n, 1, beta.CMatrix(n, opts)); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\n\tif wantst {\n\t\t// Check if reordering is correct\n\t\tlastsl = true\n\t\tsdim = 0\n\t\tfor i = 1; i <= n; i++ {\n\t\t\tcursl = selctg(alpha.Get(i-1), beta.Get(i-1))\n\t\t\tif cursl {\n\t\t\t\tsdim = sdim + 1\n\t\t\t}\n\t\t\tif cursl && !lastsl {\n\t\t\t\tinfo = n + 2\n\t\t\t}\n\t\t\tlastsl = cursl\n\t\t}\n\n\t}\n\nlabel30:\n\t;\n\n\twork.SetRe(0, float64(lwkopt))\n\n\treturn\n}",
"func TestEtmMonitor(t *testing.T) {\n\tmon := Monitor()\n\n\t// Generate measurings.\n\tfor i := 0; i < 500; i++ {\n\t\tn := rand.Intn(10)\n\t\tid := fmt.Sprintf(\"Work %d\", n)\n\t\tm := mon.BeginMeasuring(id)\n\n\t\twork(n * 5000)\n\n\t\tm.EndMeasuring()\n\t}\n\n\t// Print, process with error, and print again.\n\tmon.MeasuringPointsPrintAll()\n\n\tmon.MeasuringPointsDo(func(mp *MeasuringPoint) {\n\t\tif mp.Count >= 25 {\n\t\t\t// Divide by zero.\n\t\t\tmp.Count = mp.Count / (mp.Count - mp.Count)\n\t\t}\n\t})\n\n\tmon.MeasuringPointsPrintAll()\n}",
"func printMST(parent []int, vertices int, graph [][]float64, k int) {\n\n\tfmt.Println(\"Edge Weight\")\n\n\tfor i := 1; i < vertices; i++ {\n\t\tif comp.numberOfComponents != 1 {\n\t\t\tfmt.Printf(\"%d - %d %f \\n\", comp.compMaps[k][parent[i]], comp.compMaps[k][i], graph[i][parent[i]])\n\t\t\tadj_forest[comp.compMaps[k][parent[i]]-1][comp.compMaps[k][i]-1] = graph[i][parent[i]]\n\t\t\tadj_forest[comp.compMaps[k][i]-1][comp.compMaps[k][parent[i]]-1] = graph[i][parent[i]]\n\t\t} else {\n\t\t\tfmt.Printf(\"%d - %d %f \\n\", comp.compMaps[k][parent[i]+1], comp.compMaps[k][i+1], graph[i][parent[i]])\n\t\t\tadj_forest[comp.compMaps[k][parent[i]]][comp.compMaps[k][i]] = graph[i][parent[i]]\n\t\t\tadj_forest[comp.compMaps[k][i]][comp.compMaps[k][parent[i]]] = graph[i][parent[i]]\n\t\t}\n\n\t}\n\n}",
"func (impl Implementation) Dtrtrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, nrhs int, a []float64, lda int, b []float64, ldb int) (ok bool) {\n\treturn clapack.Dtrtrs(uplo, trans, diag, n, nrhs, a, lda, b, ldb)\n}",
"func Dlasq5(i0, n0 int, z *mat.Vector, pp int, tau, sigma float64, ieee bool, eps float64) (dmin, dmin1, dmin2, dn, dnm1, dnm2 float64) {\n\tvar d, dthresh, emin, half, temp, zero float64\n\tvar j4, j4p2 int\n\n\tzero = 0.0\n\thalf = 0.5\n\tif (n0 - i0 - 1) <= 0 {\n\t\treturn\n\t}\n\n\tdthresh = eps * (sigma + tau)\n\tif tau < dthresh*half {\n\t\ttau = zero\n\t}\n\tif tau != zero {\n\t\tj4 = 4*i0 + pp - 3\n\t\temin = z.Get(j4 + 4 - 1)\n\t\td = z.Get(j4-1) - tau\n\t\tdmin = d\n\t\tdmin1 = -z.Get(j4 - 1)\n\n\t\tif ieee {\n\t\t\t// Code for IEEE arithmetic.\n\t\t\tif pp == 0 {\n\t\t\t\tfor j4 = 4 * i0; j4 <= 4*(n0-3); j4 += 4 {\n\t\t\t\t\tz.Set(j4-2-1, d+z.Get(j4-1-1))\n\t\t\t\t\ttemp = z.Get(j4) / z.Get(j4-2-1)\n\t\t\t\t\td = d*temp - tau\n\t\t\t\t\tdmin = math.Min(dmin, d)\n\t\t\t\t\tz.Set(j4-1, z.Get(j4-1-1)*temp)\n\t\t\t\t\temin = math.Min(z.Get(j4-1), emin)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor j4 = 4 * i0; j4 <= 4*(n0-3); j4 += 4 {\n\t\t\t\t\tz.Set(j4-3-1, d+z.Get(j4-1))\n\t\t\t\t\ttemp = z.Get(j4+2-1) / z.Get(j4-3-1)\n\t\t\t\t\td = d*temp - tau\n\t\t\t\t\tdmin = math.Min(dmin, d)\n\t\t\t\t\tz.Set(j4-1-1, z.Get(j4-1)*temp)\n\t\t\t\t\temin = math.Min(z.Get(j4-1-1), emin)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Unroll last two steps.\n\t\t\tdnm2 = d\n\t\t\tdmin2 = dmin\n\t\t\tj4 = 4*(n0-2) - pp\n\t\t\tj4p2 = j4 + 2*pp - 1\n\t\t\tz.Set(j4-2-1, dnm2+z.Get(j4p2-1))\n\t\t\tz.Set(j4-1, z.Get(j4p2+2-1)*(z.Get(j4p2-1)/z.Get(j4-2-1)))\n\t\t\tdnm1 = z.Get(j4p2+2-1)*(dnm2/z.Get(j4-2-1)) - tau\n\t\t\tdmin = math.Min(dmin, dnm1)\n\n\t\t\tdmin1 = dmin\n\t\t\tj4 = j4 + 4\n\t\t\tj4p2 = j4 + 2*pp - 1\n\t\t\tz.Set(j4-2-1, dnm1+z.Get(j4p2-1))\n\t\t\tz.Set(j4-1, z.Get(j4p2+2-1)*(z.Get(j4p2-1)/z.Get(j4-2-1)))\n\t\t\tdn = z.Get(j4p2+2-1)*(dnm1/z.Get(j4-2-1)) - tau\n\t\t\tdmin = math.Min(dmin, dn)\n\n\t\t} else {\n\t\t\t// Code for non IEEE arithmetic.\n\t\t\tif pp == 0 {\n\t\t\t\tfor j4 = 4 * i0; j4 <= 4*(n0-3); j4 += 4 {\n\t\t\t\t\tz.Set(j4-2-1, d+z.Get(j4-1-1))\n\t\t\t\t\tif d < zero {\n\t\t\t\t\t\treturn\n\t\t\t\t\t} else {\n\t\t\t\t\t\tz.Set(j4-1, z.Get(j4)*(z.Get(j4-1-1)/z.Get(j4-2-1)))\n\t\t\t\t\t\td = z.Get(j4)*(d/z.Get(j4-2-1)) - tau\n\t\t\t\t\t}\n\t\t\t\t\tdmin = math.Min(dmin, d)\n\t\t\t\t\temin = math.Min(emin, z.Get(j4-1))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor j4 = 4 * i0; j4 <= 4*(n0-3); j4 += 4 {\n\t\t\t\t\tz.Set(j4-3-1, d+z.Get(j4-1))\n\t\t\t\t\tif d < zero {\n\t\t\t\t\t\treturn\n\t\t\t\t\t} else {\n\t\t\t\t\t\tz.Set(j4-1-1, z.Get(j4+2-1)*(z.Get(j4-1)/z.Get(j4-3-1)))\n\t\t\t\t\t\td = z.Get(j4+2-1)*(d/z.Get(j4-3-1)) - tau\n\t\t\t\t\t}\n\t\t\t\t\tdmin = math.Min(dmin, d)\n\t\t\t\t\temin = math.Min(emin, z.Get(j4-1-1))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Unroll last two steps.\n\t\t\tdnm2 = d\n\t\t\tdmin2 = dmin\n\t\t\tj4 = 4*(n0-2) - pp\n\t\t\tj4p2 = j4 + 2*pp - 1\n\t\t\tz.Set(j4-2-1, dnm2+z.Get(j4p2-1))\n\t\t\tif dnm2 < zero {\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tz.Set(j4-1, z.Get(j4p2+2-1)*(z.Get(j4p2-1)/z.Get(j4-2-1)))\n\t\t\t\tdnm1 = z.Get(j4p2+2-1)*(dnm2/z.Get(j4-2-1)) - tau\n\t\t\t}\n\t\t\tdmin = math.Min(dmin, dnm1)\n\n\t\t\tdmin1 = dmin\n\t\t\tj4 = j4 + 4\n\t\t\tj4p2 = j4 + 2*pp - 1\n\t\t\tz.Set(j4-2-1, dnm1+z.Get(j4p2-1))\n\t\t\tif dnm1 < zero {\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tz.Set(j4-1, z.Get(j4p2+2-1)*(z.Get(j4p2-1)/z.Get(j4-2-1)))\n\t\t\t\tdn = z.Get(j4p2+2-1)*(dnm1/z.Get(j4-2-1)) - tau\n\t\t\t}\n\t\t\tdmin = math.Min(dmin, dn)\n\n\t\t}\n\t} else {\n\t\t// This is the version that sets d's to zero if they are small enough\n\t\tj4 = 4*i0 + pp - 3\n\t\temin = z.Get(j4 + 4 - 1)\n\t\td = z.Get(j4-1) - tau\n\t\tdmin = d\n\t\tdmin1 = -z.Get(j4 - 1)\n\t\tif ieee {\n\t\t\t// Code for IEEE arithmetic.\n\t\t\tif pp == 0 {\n\t\t\t\tfor j4 = 4 * i0; j4 <= 4*(n0-3); j4 += 4 {\n\t\t\t\t\tz.Set(j4-2-1, d+z.Get(j4-1-1))\n\t\t\t\t\ttemp = z.Get(j4) / z.Get(j4-2-1)\n\t\t\t\t\td = d*temp - tau\n\t\t\t\t\tif d < dthresh {\n\t\t\t\t\t\td = zero\n\t\t\t\t\t}\n\t\t\t\t\tdmin = math.Min(dmin, d)\n\t\t\t\t\tz.Set(j4-1, z.Get(j4-1-1)*temp)\n\t\t\t\t\temin = math.Min(z.Get(j4-1), emin)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor j4 = 4 * i0; j4 <= 4*(n0-3); j4 += 4 {\n\t\t\t\t\tz.Set(j4-3-1, d+z.Get(j4-1))\n\t\t\t\t\ttemp = z.Get(j4+2-1) / z.Get(j4-3-1)\n\t\t\t\t\td = d*temp - tau\n\t\t\t\t\tif d < dthresh {\n\t\t\t\t\t\td = zero\n\t\t\t\t\t}\n\t\t\t\t\tdmin = math.Min(dmin, d)\n\t\t\t\t\tz.Set(j4-1-1, z.Get(j4-1)*temp)\n\t\t\t\t\temin = math.Min(z.Get(j4-1-1), emin)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Unroll last two steps.\n\t\t\tdnm2 = d\n\t\t\tdmin2 = dmin\n\t\t\tj4 = 4*(n0-2) - pp\n\t\t\tj4p2 = j4 + 2*pp - 1\n\t\t\tz.Set(j4-2-1, dnm2+z.Get(j4p2-1))\n\t\t\tz.Set(j4-1, z.Get(j4p2+2-1)*(z.Get(j4p2-1)/z.Get(j4-2-1)))\n\t\t\tdnm1 = z.Get(j4p2+2-1)*(dnm2/z.Get(j4-2-1)) - tau\n\t\t\tdmin = math.Min(dmin, dnm1)\n\t\t\t//\n\t\t\tdmin1 = dmin\n\t\t\tj4 = j4 + 4\n\t\t\tj4p2 = j4 + 2*pp - 1\n\t\t\tz.Set(j4-2-1, dnm1+z.Get(j4p2-1))\n\t\t\tz.Set(j4-1, z.Get(j4p2+2-1)*(z.Get(j4p2-1)/z.Get(j4-2-1)))\n\t\t\tdn = z.Get(j4p2+2-1)*(dnm1/z.Get(j4-2-1)) - tau\n\t\t\tdmin = math.Min(dmin, dn)\n\n\t\t} else {\n\t\t\t// Code for non IEEE arithmetic.\n\t\t\tif pp == 0 {\n\t\t\t\tfor j4 = 4 * i0; j4 <= 4*(n0-3); j4 += 4 {\n\t\t\t\t\tz.Set(j4-2-1, d+z.Get(j4-1-1))\n\t\t\t\t\tif d < zero {\n\t\t\t\t\t\treturn\n\t\t\t\t\t} else {\n\t\t\t\t\t\tz.Set(j4-1, z.Get(j4)*(z.Get(j4-1-1)/z.Get(j4-2-1)))\n\t\t\t\t\t\td = z.Get(j4)*(d/z.Get(j4-2-1)) - tau\n\t\t\t\t\t}\n\t\t\t\t\tif d < dthresh {\n\t\t\t\t\t\td = zero\n\t\t\t\t\t}\n\t\t\t\t\tdmin = math.Min(dmin, d)\n\t\t\t\t\temin = math.Min(emin, z.Get(j4-1))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor j4 = 4 * i0; j4 <= 4*(n0-3); j4 += 4 {\n\t\t\t\t\tz.Set(j4-3-1, d+z.Get(j4-1))\n\t\t\t\t\tif d < zero {\n\t\t\t\t\t\treturn\n\t\t\t\t\t} else {\n\t\t\t\t\t\tz.Set(j4-1-1, z.Get(j4+2-1)*(z.Get(j4-1)/z.Get(j4-3-1)))\n\t\t\t\t\t\td = z.Get(j4+2-1)*(d/z.Get(j4-3-1)) - tau\n\t\t\t\t\t}\n\t\t\t\t\tif d < dthresh {\n\t\t\t\t\t\td = zero\n\t\t\t\t\t}\n\t\t\t\t\tdmin = math.Min(dmin, d)\n\t\t\t\t\temin = math.Min(emin, z.Get(j4-1-1))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Unroll last two steps.\n\t\t\tdnm2 = d\n\t\t\tdmin2 = dmin\n\t\t\tj4 = 4*(n0-2) - pp\n\t\t\tj4p2 = j4 + 2*pp - 1\n\t\t\tz.Set(j4-2-1, dnm2+z.Get(j4p2-1))\n\t\t\tif dnm2 < zero {\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tz.Set(j4-1, z.Get(j4p2+2-1)*(z.Get(j4p2-1)/z.Get(j4-2-1)))\n\t\t\t\tdnm1 = z.Get(j4p2+2-1)*(dnm2/z.Get(j4-2-1)) - tau\n\t\t\t}\n\t\t\tdmin = math.Min(dmin, dnm1)\n\n\t\t\tdmin1 = dmin\n\t\t\tj4 = j4 + 4\n\t\t\tj4p2 = j4 + 2*pp - 1\n\t\t\tz.Set(j4-2-1, dnm1+z.Get(j4p2-1))\n\t\t\tif dnm1 < zero {\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tz.Set(j4-1, z.Get(j4p2+2-1)*(z.Get(j4p2-1)/z.Get(j4-2-1)))\n\t\t\t\tdn = z.Get(j4p2+2-1)*(dnm1/z.Get(j4-2-1)) - tau\n\t\t\t}\n\t\t\tdmin = math.Min(dmin, dn)\n\n\t\t}\n\t}\n\n\tz.Set(j4+2-1, dn)\n\tz.Set(4*n0-pp-1, emin)\n\n\treturn\n}",
"func zerrhe(path string, t *testing.T) {\n\tvar anrm float64\n\tvar i, j, nmax int\n\tvar err error\n\n\tnmax = 4\n\tb := cvf(4)\n\te := cvf(4)\n\tw := cvf(2 * nmax)\n\tx := cvf(4)\n\tr := vf(4)\n\tr1 := vf(4)\n\tr2 := vf(4)\n\tip := make([]int, 4)\n\ta := cmf(4, 4, opts)\n\taf := cmf(4, 4, opts)\n\n\terrt := &gltest.Common.Infoc.Errt\n\tok := &gltest.Common.Infoc.Ok\n\tsrnamt := &gltest.Common.Srnamc.Srnamt\n\tc2 := path[1:3]\n\n\t// Set the variables to innocuous values.\n\tfor j = 1; j <= nmax; j++ {\n\t\tfor i = 1; i <= nmax; i++ {\n\t\t\ta.Set(i-1, j-1, complex(1./float64(i+j), -1./float64(i+j)))\n\t\t\taf.Set(i-1, j-1, complex(1./float64(i+j), -1./float64(i+j)))\n\t\t}\n\t\tb.Set(j-1, 0.)\n\t\te.Set(j-1, 0.)\n\t\tr1.Set(j-1, 0.)\n\t\tr2.Set(j-1, 0.)\n\t\tw.Set(j-1, 0.)\n\t\tx.Set(j-1, 0.)\n\t\tip[j-1] = j\n\t}\n\tanrm = 1.0\n\t(*ok) = true\n\n\tif c2 == \"he\" {\n\t\t// Test error exits of the routines that use factorization\n\t\t// of a Hermitian indefinite matrix with patrial\n\t\t// (Bunch-Kaufman) diagonal pivoting method.\n\t\t//\n\t\t// Zhetrf\n\t\t*srnamt = \"Zhetrf\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.Zhetrf('/', 0, a.Off(0, 0).UpdateRows(1), &ip, w, 1)\n\t\tchkxer2(\"Zhetrf\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.Zhetrf(Upper, -1, a.Off(0, 0).UpdateRows(1), &ip, w, 1)\n\t\tchkxer2(\"Zhetrf\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.Zhetrf(Upper, 2, a.Off(0, 0).UpdateRows(1), &ip, w, 4)\n\t\tchkxer2(\"Zhetrf\", err)\n\t\t*errt = fmt.Errorf(\"lwork < 1 && !lquery: lwork=0, lquery=false\")\n\t\t_, err = golapack.Zhetrf(Upper, 0, a.Off(0, 0).UpdateRows(1), &ip, w, 0)\n\t\tchkxer2(\"Zhetrf\", err)\n\t\t*errt = fmt.Errorf(\"lwork < 1 && !lquery: lwork=-2, lquery=false\")\n\t\t_, err = golapack.Zhetrf(Upper, 0, a.Off(0, 0).UpdateRows(1), &ip, w, -2)\n\t\tchkxer2(\"Zhetrf\", err)\n\n\t\t// Zhetf2\n\t\t*srnamt = \"Zhetf2\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.Zhetf2('/', 0, a.Off(0, 0).UpdateRows(1), &ip)\n\t\tchkxer2(\"Zhetf2\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.Zhetf2(Upper, -1, a.Off(0, 0).UpdateRows(1), &ip)\n\t\tchkxer2(\"Zhetf2\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.Zhetf2(Upper, 2, a.Off(0, 0).UpdateRows(1), &ip)\n\t\tchkxer2(\"Zhetf2\", err)\n\n\t\t// Zhetri\n\t\t*srnamt = \"Zhetri\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.Zhetri('/', 0, a.Off(0, 0).UpdateRows(1), &ip, w)\n\t\tchkxer2(\"Zhetri\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.Zhetri(Upper, -1, a.Off(0, 0).UpdateRows(1), &ip, w)\n\t\tchkxer2(\"Zhetri\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.Zhetri(Upper, 2, a.Off(0, 0).UpdateRows(1), &ip, w)\n\t\tchkxer2(\"Zhetri\", err)\n\n\t\t// Zhetri2\n\t\t*srnamt = \"Zhetri2\"\n\t\t// *errt = fmt.Errorf(\"lwork < minsize && !lquery: lwork=%v, minsize=%v, lquery=%v\", lwork, minsize, lquery)\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.Zhetri2('/', 0, a.Off(0, 0).UpdateRows(1), &ip, w, 1)\n\t\tchkxer2(\"Zhetri2\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.Zhetri2(Upper, -1, a.Off(0, 0).UpdateRows(1), &ip, w, 1)\n\t\tchkxer2(\"Zhetri2\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.Zhetri2(Upper, 2, a.Off(0, 0).UpdateRows(1), &ip, w, 1)\n\t\tchkxer2(\"Zhetri2\", err)\n\n\t\t// Zhetri2x\n\t\t*srnamt = \"Zhetri2x\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.Zhetri2x('/', 0, a.Off(0, 0).UpdateRows(1), &ip, w.CMatrix(1, opts), 1)\n\t\tchkxer2(\"Zhetri2x\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.Zhetri2x(Upper, -1, a.Off(0, 0).UpdateRows(1), &ip, w.CMatrix(1, opts), 1)\n\t\tchkxer2(\"Zhetri2x\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.Zhetri2x(Upper, 2, a.Off(0, 0).UpdateRows(1), &ip, w.CMatrix(1, opts), 1)\n\t\tchkxer2(\"Zhetri2x\", err)\n\n\t\t// Zhetrs\n\t\t*srnamt = \"Zhetrs\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\terr = golapack.Zhetrs('/', 0, 0, a.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"Zhetrs\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\terr = golapack.Zhetrs(Upper, -1, 0, a.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"Zhetrs\", err)\n\t\t*errt = fmt.Errorf(\"nrhs < 0: nrhs=-1\")\n\t\terr = golapack.Zhetrs(Upper, 0, -1, a.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"Zhetrs\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\terr = golapack.Zhetrs(Upper, 2, 1, a.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(2, opts))\n\t\tchkxer2(\"Zhetrs\", err)\n\t\t*errt = fmt.Errorf(\"b.Rows < max(1, n): b.Rows=1, n=2\")\n\t\terr = golapack.Zhetrs(Upper, 2, 1, a.Off(0, 0).UpdateRows(2), &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"Zhetrs\", err)\n\n\t\t// Zhetrfs\n\t\t*srnamt = \"Zherfs\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\terr = golapack.Zherfs('/', 0, 0, a.Off(0, 0).UpdateRows(1), af.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(1, opts), x.CMatrix(1, opts), r1, r2, w, r)\n\t\tchkxer2(\"Zherfs\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\terr = golapack.Zherfs(Upper, -1, 0, a.Off(0, 0).UpdateRows(1), af.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(1, opts), x.CMatrix(1, opts), r1, r2, w, r)\n\t\tchkxer2(\"Zherfs\", err)\n\t\t*errt = fmt.Errorf(\"nrhs < 0: nrhs=-1\")\n\t\terr = golapack.Zherfs(Upper, 0, -1, a.Off(0, 0).UpdateRows(1), af.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(1, opts), x.CMatrix(1, opts), r1, r2, w, r)\n\t\tchkxer2(\"Zherfs\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\terr = golapack.Zherfs(Upper, 2, 1, a.Off(0, 0).UpdateRows(1), af.Off(0, 0).UpdateRows(2), &ip, b.CMatrix(2, opts), x.CMatrix(2, opts), r1, r2, w, r)\n\t\tchkxer2(\"Zherfs\", err)\n\t\t*errt = fmt.Errorf(\"af.Rows < max(1, n): af.Rows=1, n=2\")\n\t\terr = golapack.Zherfs(Upper, 2, 1, a.Off(0, 0).UpdateRows(2), af.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(2, opts), x.CMatrix(2, opts), r1, r2, w, r)\n\t\tchkxer2(\"Zherfs\", err)\n\t\t*errt = fmt.Errorf(\"b.Rows < max(1, n): b.Rows=1, n=2\")\n\t\terr = golapack.Zherfs(Upper, 2, 1, a.Off(0, 0).UpdateRows(2), af.Off(0, 0).UpdateRows(2), &ip, b.CMatrix(1, opts), x.CMatrix(2, opts), r1, r2, w, r)\n\t\tchkxer2(\"Zherfs\", err)\n\t\t*errt = fmt.Errorf(\"x.Rows < max(1, n): x.Rows=1, n=2\")\n\t\terr = golapack.Zherfs(Upper, 2, 1, a.Off(0, 0).UpdateRows(2), af.Off(0, 0).UpdateRows(2), &ip, b.CMatrix(2, opts), x.CMatrix(1, opts), r1, r2, w, r)\n\t\tchkxer2(\"Zherfs\", err)\n\n\t\t// Zhecon\n\t\t*srnamt = \"Zhecon\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.Zhecon('/', 0, a.Off(0, 0).UpdateRows(1), &ip, anrm, w)\n\t\tchkxer2(\"Zhecon\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.Zhecon(Upper, -1, a.Off(0, 0).UpdateRows(1), &ip, anrm, w)\n\t\tchkxer2(\"Zhecon\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.Zhecon(Upper, 2, a.Off(0, 0).UpdateRows(1), &ip, anrm, w)\n\t\tchkxer2(\"Zhecon\", err)\n\t\t*errt = fmt.Errorf(\"anorm < zero: anorm=-1\")\n\t\t_, err = golapack.Zhecon(Upper, 1, a.Off(0, 0).UpdateRows(1), &ip, -anrm, w)\n\t\tchkxer2(\"Zhecon\", err)\n\n\t} else if c2 == \"hr\" {\n\t\t// Test error exits of the routines that use factorization\n\t\t// of a Hermitian indefinite matrix with rook\n\t\t// (bounded Bunch-Kaufman) diagonal pivoting method.\n\t\t//\n\t\t// ZhetrfRook\n\t\t*srnamt = \"ZhetrfRook\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.ZhetrfRook('/', 0, a.Off(0, 0).UpdateRows(1), &ip, w, 1)\n\t\tchkxer2(\"ZhetrfRook\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.ZhetrfRook(Upper, -1, a.Off(0, 0).UpdateRows(1), &ip, w, 1)\n\t\tchkxer2(\"ZhetrfRook\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.ZhetrfRook(Upper, 2, a.Off(0, 0).UpdateRows(1), &ip, w, 4)\n\t\tchkxer2(\"ZhetrfRook\", err)\n\t\t*errt = fmt.Errorf(\"lwork < 1 && !lquery: lwork=0, lquery=false\")\n\t\t_, err = golapack.ZhetrfRook(Upper, 0, a.Off(0, 0).UpdateRows(1), &ip, w, 0)\n\t\tchkxer2(\"ZhetrfRook\", err)\n\t\t*errt = fmt.Errorf(\"lwork < 1 && !lquery: lwork=-2, lquery=false\")\n\t\t_, err = golapack.ZhetrfRook(Upper, 0, a.Off(0, 0).UpdateRows(1), &ip, w, -2)\n\t\tchkxer2(\"ZhetrfRook\", err)\n\n\t\t// Zhetf2Rook\n\t\t*srnamt = \"Zhetf2Rook\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.Zhetf2Rook('/', 0, a.Off(0, 0).UpdateRows(1), &ip)\n\t\tchkxer2(\"Zhetf2Rook\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.Zhetf2Rook(Upper, -1, a.Off(0, 0).UpdateRows(1), &ip)\n\t\tchkxer2(\"Zhetf2Rook\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.Zhetf2Rook(Upper, 2, a.Off(0, 0).UpdateRows(1), &ip)\n\t\tchkxer2(\"Zhetf2Rook\", err)\n\n\t\t// ZhetriRook\n\t\t*srnamt = \"ZhetriRook\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.ZhetriRook('/', 0, a.Off(0, 0).UpdateRows(1), &ip, w)\n\t\tchkxer2(\"ZhetriRook\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.ZhetriRook(Upper, -1, a.Off(0, 0).UpdateRows(1), &ip, w)\n\t\tchkxer2(\"ZhetriRook\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.ZhetriRook(Upper, 2, a.Off(0, 0).UpdateRows(1), &ip, w)\n\t\tchkxer2(\"ZhetriRook\", err)\n\n\t\t// ZhetrsRook\n\t\t*srnamt = \"ZhetrsRook\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\terr = golapack.ZhetrsRook('/', 0, 0, a.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"ZhetrsRook\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\terr = golapack.ZhetrsRook(Upper, -1, 0, a.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"ZhetrsRook\", err)\n\t\t*errt = fmt.Errorf(\"nrhs < 0: nrhs=-1\")\n\t\terr = golapack.ZhetrsRook(Upper, 0, -1, a.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"ZhetrsRook\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\terr = golapack.ZhetrsRook(Upper, 2, 1, a.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(2, opts))\n\t\tchkxer2(\"ZhetrsRook\", err)\n\t\t*errt = fmt.Errorf(\"b.Rows < max(1, n): b.Rows=1, n=2\")\n\t\terr = golapack.ZhetrsRook(Upper, 2, 1, a.Off(0, 0).UpdateRows(2), &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"ZhetrsRook\", err)\n\n\t\t// ZheconRook\n\t\t*srnamt = \"ZheconRook\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.ZheconRook('/', 0, a.Off(0, 0).UpdateRows(1), &ip, anrm, w)\n\t\tchkxer2(\"ZheconRook\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.ZheconRook(Upper, -1, a.Off(0, 0).UpdateRows(1), &ip, anrm, w)\n\t\tchkxer2(\"ZheconRook\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.ZheconRook(Upper, 2, a.Off(0, 0).UpdateRows(1), &ip, anrm, w)\n\t\tchkxer2(\"ZheconRook\", err)\n\t\t*errt = fmt.Errorf(\"anorm < zero: anorm=-1\")\n\t\t_, err = golapack.ZheconRook(Upper, 1, a.Off(0, 0).UpdateRows(1), &ip, -anrm, w)\n\t\tchkxer2(\"ZheconRook\", err)\n\n\t} else if c2 == \"hk\" {\n\t\t// Test error exits of the routines that use factorization\n\t\t// of a symmetric indefinite matrix with rook\n\t\t// (bounded Bunch-Kaufman) pivoting with the new storage\n\t\t// format for factors L ( or U) and D.\n\t\t//\n\t\t// L (or U) is stored in A, diagonal of D is stored on the\n\t\t// diagonal of A, subdiagonal of D is stored in a separate array E.\n\t\t//\n\t\t// ZhetrfRk\n\t\t*srnamt = \"ZhetrfRk\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.ZhetrfRk('/', 0, a.Off(0, 0).UpdateRows(1), e, &ip, w, 1)\n\t\tchkxer2(\"ZhetrfRk\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.ZhetrfRk(Upper, -1, a.Off(0, 0).UpdateRows(1), e, &ip, w, 1)\n\t\tchkxer2(\"ZhetrfRk\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.ZhetrfRk(Upper, 2, a.Off(0, 0).UpdateRows(1), e, &ip, w, 4)\n\t\tchkxer2(\"ZhetrfRk\", err)\n\t\t*errt = fmt.Errorf(\"lwork < 1 && !lquery: lwork=0, lquery=false\")\n\t\t_, err = golapack.ZhetrfRk(Upper, 0, a.Off(0, 0).UpdateRows(1), e, &ip, w, 0)\n\t\tchkxer2(\"ZhetrfRk\", err)\n\t\t*errt = fmt.Errorf(\"lwork < 1 && !lquery: lwork=-2, lquery=false\")\n\t\t_, err = golapack.ZhetrfRk(Upper, 0, a.Off(0, 0).UpdateRows(1), e, &ip, w, -2)\n\t\tchkxer2(\"ZhetrfRk\", err)\n\n\t\t// Zhetf2Rk\n\t\t*srnamt = \"Zhetf2Rk\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.Zhetf2Rk('/', 0, a.Off(0, 0).UpdateRows(1), e, &ip)\n\t\tchkxer2(\"Zhetf2Rk\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.Zhetf2Rk(Upper, -1, a.Off(0, 0).UpdateRows(1), e, &ip)\n\t\tchkxer2(\"Zhetf2Rk\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.Zhetf2Rk(Upper, 2, a.Off(0, 0).UpdateRows(1), e, &ip)\n\t\tchkxer2(\"Zhetf2Rk\", err)\n\n\t\t// Zhetri3\n\t\t*srnamt = \"Zhetri3\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.Zhetri3('/', 0, a.Off(0, 0).UpdateRows(1), e, &ip, w, 1)\n\t\tchkxer2(\"Zhetri3\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.Zhetri3(Upper, -1, a.Off(0, 0).UpdateRows(1), e, &ip, w, 1)\n\t\tchkxer2(\"Zhetri3\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.Zhetri3(Upper, 2, a.Off(0, 0).UpdateRows(1), e, &ip, w, 1)\n\t\tchkxer2(\"Zhetri3\", err)\n\t\t*errt = fmt.Errorf(\"lwork < lwkopt && !lquery: lwork=0, lwkopt=8, lquery=false\")\n\t\t_, err = golapack.Zhetri3(Upper, 0, a.Off(0, 0).UpdateRows(1), e, &ip, w, 0)\n\t\tchkxer2(\"Zhetri3\", err)\n\t\t*errt = fmt.Errorf(\"lwork < lwkopt && !lquery: lwork=-2, lwkopt=8, lquery=false\")\n\t\t_, err = golapack.Zhetri3(Upper, 0, a.Off(0, 0).UpdateRows(1), e, &ip, w, -2)\n\t\tchkxer2(\"Zhetri3\", err)\n\n\t\t// Zhetri3x\n\t\t*srnamt = \"Zhetri3x\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.Zhetri3x('/', 0, a.Off(0, 0).UpdateRows(1), e, &ip, w.CMatrix(1, opts), 1)\n\t\tchkxer2(\"Zhetri3x\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.Zhetri3x(Upper, -1, a.Off(0, 0).UpdateRows(1), e, &ip, w.CMatrix(1, opts), 1)\n\t\tchkxer2(\"Zhetri3x\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.Zhetri3x(Upper, 2, a.Off(0, 0).UpdateRows(1), e, &ip, w.CMatrix(1, opts), 1)\n\t\tchkxer2(\"Zhetri3x\", err)\n\n\t\t// Zhetrs3\n\t\t*srnamt = \"Zhetrs3\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\terr = golapack.Zhetrs3('/', 0, 0, a.Off(0, 0).UpdateRows(1), e, &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"Zhetrs3\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\terr = golapack.Zhetrs3(Upper, -1, 0, a.Off(0, 0).UpdateRows(1), e, &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"Zhetrs3\", err)\n\t\t*errt = fmt.Errorf(\"nrhs < 0: nrhs=-1\")\n\t\terr = golapack.Zhetrs3(Upper, 0, -1, a.Off(0, 0).UpdateRows(1), e, &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"Zhetrs3\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\terr = golapack.Zhetrs3(Upper, 2, 1, a.Off(0, 0).UpdateRows(1), e, &ip, b.CMatrix(2, opts))\n\t\tchkxer2(\"Zhetrs3\", err)\n\t\t*errt = fmt.Errorf(\"b.Rows < max(1, n): b.Rows=1, n=2\")\n\t\terr = golapack.Zhetrs3(Upper, 2, 1, a.Off(0, 0).UpdateRows(2), e, &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"Zhetrs3\", err)\n\n\t\t// Zhecon3\n\t\t*srnamt = \"Zhecon3\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.Zhecon3('/', 0, a.Off(0, 0).UpdateRows(1), e, &ip, anrm, w)\n\t\tchkxer2(\"Zhecon3\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.Zhecon3(Upper, -1, a.Off(0, 0).UpdateRows(1), e, &ip, anrm, w)\n\t\tchkxer2(\"Zhecon3\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.Zhecon3(Upper, 2, a.Off(0, 0).UpdateRows(1), e, &ip, anrm, w)\n\t\tchkxer2(\"Zhecon3\", err)\n\t\t*errt = fmt.Errorf(\"anorm < zero: anorm=-1\")\n\t\t_, err = golapack.Zhecon3(Upper, 1, a.Off(0, 0).UpdateRows(1), e, &ip, -1.0, w)\n\t\tchkxer2(\"Zhecon3\", err)\n\n\t\t// Test error exits of the routines that use factorization\n\t\t// of a Hermitian indefinite matrix with Aasen's algorithm.\n\t} else if c2 == \"ha\" {\n\t\t// ZhetrfAa\n\t\t*srnamt = \"ZhetrfAa\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\terr = golapack.ZhetrfAa('/', 0, a.Off(0, 0).UpdateRows(1), &ip, w, 1)\n\t\tchkxer2(\"ZhetrfAa\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\terr = golapack.ZhetrfAa(Upper, -1, a.Off(0, 0).UpdateRows(1), &ip, w, 1)\n\t\tchkxer2(\"ZhetrfAa\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\terr = golapack.ZhetrfAa(Upper, 2, a.Off(0, 0).UpdateRows(1), &ip, w, 4)\n\t\tchkxer2(\"ZhetrfAa\", err)\n\t\t*errt = fmt.Errorf(\"lwork < max(1, 2*n) && !lquery: lwork=0, n=0, lquery=false\")\n\t\terr = golapack.ZhetrfAa(Upper, 0, a.Off(0, 0).UpdateRows(1), &ip, w, 0)\n\t\tchkxer2(\"ZhetrfAa\", err)\n\t\t*errt = fmt.Errorf(\"lwork < max(1, 2*n) && !lquery: lwork=-2, n=0, lquery=false\")\n\t\terr = golapack.ZhetrfAa(Upper, 0, a.Off(0, 0).UpdateRows(1), &ip, w, -2)\n\t\tchkxer2(\"ZhetrfAa\", err)\n\n\t\t// ZhetrsAa\n\t\t*srnamt = \"ZhetrsAa\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.ZhetrsAa('/', 0, 0, a.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(1, opts), w, 1)\n\t\tchkxer2(\"ZhetrsAa\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.ZhetrsAa(Upper, -1, 0, a.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(1, opts), w, 1)\n\t\tchkxer2(\"ZhetrsAa\", err)\n\t\t*errt = fmt.Errorf(\"nrhs < 0: nrhs=-1\")\n\t\t_, err = golapack.ZhetrsAa(Upper, 0, -1, a.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(1, opts), w, 1)\n\t\tchkxer2(\"ZhetrsAa\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.ZhetrsAa(Upper, 2, 1, a.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(2, opts), w, 1)\n\t\tchkxer2(\"ZhetrsAa\", err)\n\t\t*errt = fmt.Errorf(\"b.Rows < max(1, n): b.Rows=1, n=2\")\n\t\t_, err = golapack.ZhetrsAa(Upper, 2, 1, a.Off(0, 0).UpdateRows(2), &ip, b.CMatrix(1, opts), w, 1)\n\t\tchkxer2(\"ZhetrsAa\", err)\n\t\t*errt = fmt.Errorf(\"lwork < max(1, 3*n-2) && !lquery: lwork=0, n=0, lquery=false\")\n\t\t_, err = golapack.ZhetrsAa(Upper, 0, 1, a.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(1, opts), w, 0)\n\t\tchkxer2(\"ZhetrsAa\", err)\n\t\t*errt = fmt.Errorf(\"lwork < max(1, 3*n-2) && !lquery: lwork=-2, n=0, lquery=false\")\n\t\t_, err = golapack.ZhetrsAa(Upper, 0, 1, a.Off(0, 0).UpdateRows(1), &ip, b.CMatrix(1, opts), w, -2)\n\t\tchkxer2(\"ZhetrsAa\", err)\n\n\t} else if c2 == \"s2\" {\n\t\t// Test error exits of the routines that use factorization\n\t\t// of a symmetric indefinite matrix with Aasen's algorithm.\n\t\t//\n\t\t// ZhetrfAa2stage\n\t\t*srnamt = \"ZhetrfAa2stage\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.ZhetrfAa2stage('/', 0, a.Off(0, 0).UpdateRows(1), a.Off(0, 0).CVector(), 1, &ip, &ip, w, 1)\n\t\tchkxer2(\"ZhetrfAa2stage\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.ZhetrfAa2stage(Upper, -1, a.Off(0, 0).UpdateRows(1), a.Off(0, 0).CVector(), 1, &ip, &ip, w, 1)\n\t\tchkxer2(\"ZhetrfAa2stage\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\t_, err = golapack.ZhetrfAa2stage(Upper, 2, a.Off(0, 0).UpdateRows(1), a.Off(0, 0).CVector(), 2, &ip, &ip, w, 1)\n\t\tchkxer2(\"ZhetrfAa2stage\", err)\n\t\t*errt = fmt.Errorf(\"ltb < 4*n && !tquery: ltb=1, n=2, tquery=false\")\n\t\t_, err = golapack.ZhetrfAa2stage(Upper, 2, a.Off(0, 0).UpdateRows(2), a.Off(0, 0).CVector(), 1, &ip, &ip, w, 1)\n\t\tchkxer2(\"ZhetrfAa2stage\", err)\n\t\t*errt = fmt.Errorf(\"lwork < n && !wquery: lwork=0, n=2, wquery=false\")\n\t\t_, err = golapack.ZhetrfAa2stage(Upper, 2, a.Off(0, 0).UpdateRows(2), a.Off(0, 0).CVector(), 8, &ip, &ip, w, 0)\n\t\tchkxer2(\"ZhetrfAa2stage\", err)\n\n\t\t// ZhetrsAa2stage\n\t\t*srnamt = \"ZhetrsAa2stage\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\terr = golapack.ZhetrsAa2stage('/', 0, 0, a.Off(0, 0).UpdateRows(1), a.Off(0, 0).CVector(), 1, &ip, &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"ZhetrsAa2stage\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\terr = golapack.ZhetrsAa2stage(Upper, -1, 0, a.Off(0, 0).UpdateRows(1), a.Off(0, 0).CVector(), 1, &ip, &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"ZhetrsAa2stage\", err)\n\t\t*errt = fmt.Errorf(\"nrhs < 0: nrhs=-1\")\n\t\terr = golapack.ZhetrsAa2stage(Upper, 0, -1, a.Off(0, 0).UpdateRows(1), a.Off(0, 0).CVector(), 1, &ip, &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"ZhetrsAa2stage\", err)\n\t\t*errt = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=1, n=2\")\n\t\terr = golapack.ZhetrsAa2stage(Upper, 2, 1, a.Off(0, 0).UpdateRows(1), a.Off(0, 0).CVector(), 1, &ip, &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"ZhetrsAa2stage\", err)\n\t\t*errt = fmt.Errorf(\"ltb < (4 * n): ltb=1, n=2\")\n\t\terr = golapack.ZhetrsAa2stage(Upper, 2, 1, a.Off(0, 0).UpdateRows(2), a.Off(0, 0).CVector(), 1, &ip, &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"ZhetrsAa2stage\", err)\n\t\t*errt = fmt.Errorf(\"b.Rows < max(1, n): b.Rows=1, n=2\")\n\t\terr = golapack.ZhetrsAa2stage(Upper, 2, 1, a.Off(0, 0).UpdateRows(2), a.Off(0, 0).CVector(), 8, &ip, &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"ZhetrsAa2stage\", err)\n\n\t} else if c2 == \"hp\" {\n\t\t// Test error exits of the routines that use factorization\n\t\t// of a Hermitian indefinite packed matrix with patrial\n\t\t// (Bunch-Kaufman) diagonal pivoting method.\n\t\t//\n\t\t// Zhptrf\n\t\t*srnamt = \"Zhptrf\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.Zhptrf('/', 0, a.Off(0, 0).CVector(), &ip)\n\t\tchkxer2(\"Zhptrf\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.Zhptrf(Upper, -1, a.Off(0, 0).CVector(), &ip)\n\t\tchkxer2(\"Zhptrf\", err)\n\n\t\t// Zhptri\n\t\t*srnamt = \"Zhptri\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.Zhptri('/', 0, a.Off(0, 0).CVector(), &ip, w)\n\t\tchkxer2(\"Zhptri\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.Zhptri(Upper, -1, a.Off(0, 0).CVector(), &ip, w)\n\t\tchkxer2(\"Zhptri\", err)\n\n\t\t// Zhptrs\n\t\t*srnamt = \"Zhptrs\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\terr = golapack.Zhptrs('/', 0, 0, a.Off(0, 0).CVector(), &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"Zhptrs\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\terr = golapack.Zhptrs(Upper, -1, 0, a.Off(0, 0).CVector(), &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"Zhptrs\", err)\n\t\t*errt = fmt.Errorf(\"nrhs < 0: nrhs=-1\")\n\t\terr = golapack.Zhptrs(Upper, 0, -1, a.Off(0, 0).CVector(), &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"Zhptrs\", err)\n\t\t*errt = fmt.Errorf(\"b.Rows < max(1, n): b.Rows=1, n=2\")\n\t\terr = golapack.Zhptrs(Upper, 2, 1, a.Off(0, 0).CVector(), &ip, b.CMatrix(1, opts))\n\t\tchkxer2(\"Zhptrs\", err)\n\n\t\t// Zhprfs\n\t\t*srnamt = \"Zhprfs\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\terr = golapack.Zhprfs('/', 0, 0, a.Off(0, 0).CVector(), af.Off(0, 0).CVector(), &ip, b.CMatrix(1, opts), x.CMatrix(1, opts), r1, r2, w, r)\n\t\tchkxer2(\"Zhprfs\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\terr = golapack.Zhprfs(Upper, -1, 0, a.Off(0, 0).CVector(), af.Off(0, 0).CVector(), &ip, b.CMatrix(1, opts), x.CMatrix(1, opts), r1, r2, w, r)\n\t\tchkxer2(\"Zhprfs\", err)\n\t\t*errt = fmt.Errorf(\"nrhs < 0: nrhs=-1\")\n\t\terr = golapack.Zhprfs(Upper, 0, -1, a.Off(0, 0).CVector(), af.Off(0, 0).CVector(), &ip, b.CMatrix(1, opts), x.CMatrix(1, opts), r1, r2, w, r)\n\t\tchkxer2(\"Zhprfs\", err)\n\t\t*errt = fmt.Errorf(\"b.Rows < max(1, n): b.Rows=1, n=2\")\n\t\terr = golapack.Zhprfs(Upper, 2, 1, a.Off(0, 0).CVector(), af.Off(0, 0).CVector(), &ip, b.CMatrix(1, opts), x.CMatrix(2, opts), r1, r2, w, r)\n\t\tchkxer2(\"Zhprfs\", err)\n\t\t*errt = fmt.Errorf(\"x.Rows < max(1, n): x.Rows=1, n=2\")\n\t\terr = golapack.Zhprfs(Upper, 2, 1, a.Off(0, 0).CVector(), af.Off(0, 0).CVector(), &ip, b.CMatrix(2, opts), x.CMatrix(1, opts), r1, r2, w, r)\n\t\tchkxer2(\"Zhprfs\", err)\n\n\t\t// Zhpcon\n\t\t*srnamt = \"Zhpcon\"\n\t\t*errt = fmt.Errorf(\"!upper && uplo != Lower: uplo=Unrecognized: /\")\n\t\t_, err = golapack.Zhpcon('/', 0, a.Off(0, 0).CVector(), &ip, anrm, w)\n\t\tchkxer2(\"Zhpcon\", err)\n\t\t*errt = fmt.Errorf(\"n < 0: n=-1\")\n\t\t_, err = golapack.Zhpcon(Upper, -1, a.Off(0, 0).CVector(), &ip, anrm, w)\n\t\tchkxer2(\"Zhpcon\", err)\n\t\t*errt = fmt.Errorf(\"anorm < zero: anorm=-1\")\n\t\t_, err = golapack.Zhpcon(Upper, 1, a.Off(0, 0).CVector(), &ip, -anrm, w)\n\t\tchkxer2(\"Zhpcon\", err)\n\t}\n\n\t// Print a summary line.\n\t// alaesm(path, *ok)\n\n\tif !(*ok) {\n\t\tt.Fail()\n\t}\n}",
"func enetCoordinateDescent(w *mat.VecDense, alpha, beta float64, X *mat.Dense, Y *mat.VecDense, maxIter int, tol float64, rng base.Intner, random, positive bool) *CDResult {\n\t/*\n\t coordinate descent algorithm\n\t for Elastic-Net regression\n\t We minimize\n\t (1/2) * norm(y - X w, 2)^2 + alpha norm(w, 1) + (beta/2) norm(w, 2)^2\n\t*/\n\tgap := tol + 1.\n\tdwtol := tol\n\n\t_, NFeatures := X.Dims()\n\tR := &mat.VecDense{}\n\trmX := X.RawMatrix()\n\t// # norm_cols_X = (np.asarray(X) ** 2).sum(axis=0)\n\tnormColsX := make([]float64, NFeatures)\n\tfor r, rp := 0, 0; r < rmX.Rows; r, rp = r+1, rp+rmX.Stride {\n\t\tfor c := 0; c < rmX.Cols; c++ {\n\t\t\te := rmX.Data[rp+c]\n\t\t\tnormColsX[c] += e * e\n\t\t}\n\t}\n\t// # R = Y - np.dot(X, W.T)\n\tR.MulVec(X, w)\n\tR.SubVec(Y, R)\n\n\t// # tol = tol * linalg.norm(Y, ord='fro') ** 2\n\t{\n\t\tY2 := &mat.VecDense{}\n\t\tY2.MulElemVec(Y, Y)\n\t\ttol *= mat.Sum(Y2)\n\t}\n\tvar nIter int\n\tvar wii, dwii, wmax, dwmax, dualNormXtA, cons, l1norm float64\n\ttmp := &mat.VecDense{}\n\tXtA := &mat.VecDense{}\n\tXtArv := XtA.RawVector()\n\n\tRNorm2, wNorm2 := &mat.VecDense{}, &mat.VecDense{}\n\tRNorm2rv, wNorm2rv := RNorm2.RawVector(), wNorm2.RawVector()\n\tRY := &mat.VecDense{}\n\n\tfsign := func(x float64) float64 {\n\t\tif x > 0 {\n\t\t\treturn 1.\n\t\t} else if x == 0. {\n\t\t\treturn 0.\n\t\t}\n\t\treturn -1\n\t}\n\n\tfor nIter = 0; nIter < maxIter; nIter++ {\n\t\twmax, dwmax = 0., 0.\n\t\tvar ii int\n\t\tfor fIter := 0; fIter < NFeatures; fIter++ {\n\t\t\tif random {\n\t\t\t\tif rng != nil {\n\t\t\t\t\tii = rng.Intn(NFeatures)\n\t\t\t\t} else {\n\t\t\t\t\tii = rand.Intn(NFeatures)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tii = fIter\n\t\t\t}\n\t\t\tif normColsX[ii] == 0. {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// # w_ii = W[:, ii] # Store previous value\n\t\t\twii = w.AtVec(ii) // store previous value\n\n\t\t\tif wii != 0. {\n\t\t\t\t// # R += w_ii * X[:,ii]\n\t\t\t\tR.AddScaledVec(R, wii, X.ColView(ii))\n\t\t\t}\n\n\t\t\t// # tmp = (X[:,ii]*R).sum()\n\n\t\t\ttmp.MulVec(X.ColView(ii).T(), R)\n\n\t\t\tif positive && tmp.AtVec(0) < 0. {\n\t\t\t\tw.SetVec(ii, 0)\n\t\t\t} else {\n\t\t\t\tw.SetVec(ii, (fsign(tmp.AtVec(0))*math.Max(math.Abs(tmp.AtVec(0))-alpha, 0))/(normColsX[ii]+beta))\n\t\t\t}\n\n\t\t\tif w.AtVec(ii) != 0. {\n\t\t\t\t// # R -= w[ii] * X[:,ii] # Update residual\n\t\t\t\tR.AddScaledVec(R, -w.AtVec(ii), X.ColView(ii))\n\t\t\t}\n\t\t\t// # update the maximum absolute coefficient update\n\t\t\tdwii = math.Abs(w.AtVec(ii) - wii)\n\n\t\t\tif dwii > dwmax {\n\t\t\t\tdwmax = dwii\n\t\t\t}\n\t\t\tif math.Abs(w.AtVec(ii)) > wmax {\n\t\t\t\twmax = math.Abs(w.AtVec(ii))\n\t\t\t}\n\n\t\t}\n\t\tif wmax == 0. || dwmax/wmax < dwtol || nIter == maxIter-1 {\n\t\t\t// # the biggest coordinate update of this iteration was smaller\n\t\t\t// # than the tolerance: check the duality gap as ultimate\n\t\t\t// # stopping criterion\n\n\t\t\t// # XtA = np.dot(X.T, R) - beta * w\n\t\t\tXtA.MulVec(X.T(), R)\n\t\t\tXtArv = XtA.RawVector()\n\t\t\tXtA.AddScaledVec(XtA, -beta, w)\n\t\t\tif positive {\n\t\t\t\tdualNormXtA = mat.Max(XtA)\n\t\t\t} else {\n\t\t\t\tdualNormXtA = math.Abs(XtA.AtVec(blas64.Iamax(XtArv)))\n\t\t\t}\n\t\t\t// # R_norm2 = np.dot(R, R)\n\t\t\tRNorm2.MulVec(R.T(), R)\n\t\t\tRNorm2rv = RNorm2.RawVector()\n\t\t\t// # w_norm2 = np.dot(w, w)\n\t\t\twNorm2.MulVec(w.T(), w)\n\t\t\twNorm2rv = wNorm2.RawVector()\n\n\t\t\tif dualNormXtA > alpha {\n\t\t\t\tcons = alpha / dualNormXtA\n\t\t\t\tANorm2 := RNorm2rv.Data[0] * cons * cons\n\t\t\t\tgap = .5 * (RNorm2rv.Data[0] + ANorm2)\n\t\t\t} else {\n\t\t\t\tcons = 1.\n\t\t\t\tgap = RNorm2rv.Data[0]\n\t\t\t}\n\t\t\tl1norm = blas64.Asum(w.RawVector())\n\t\t\tRY.MulElemVec(R, Y)\n\t\t\tgap += (alpha*l1norm - cons*mat.Sum(RY)) + .5*beta*(1.+cons*cons)*wNorm2rv.Data[0]\n\t\t\t// fmt.Printf(\"R:\\n%.6f\\nW:\\n%.6f\\nXtA:\\n%.6f\\n\", mat.Formatted(R.T()), mat.Formatted(w.T()), mat.Formatted(XtA.T()))\n\t\t\t// fmt.Println(\"dwmax\", dwmax, \"wmax\", wmax, \"dwtol\", dwtol)\n\t\t\t// fmt.Println(nIter, gap, \"l1reg\", alpha, \"l2reg\", beta, \"l21norm\", l1norm, \"sumRY\", cons*mat.Sum(RY), \"dualNormXtA\", dualNormXtA, \"RNorm\", math.Sqrt(RNorm2rv.Data[0]), \"gap\", gap)\n\n\t\t\tif gap < tol {\n\t\t\t\t// # return if we reached desired tolerance\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t}\n\treturn &CDResult{Gap: gap, Eps: tol, NIter: nIter + 1}\n}",
"func (m Matrix) Det() (float64, error) {\n\n\tvar det float64\n\tvar err error\n\n\t// Check if matrix is square\n\tif !m.IsSquare() {\n\t\treturn det, ErrMatNotSq\n\t}\n\n\t// Get matrix dimensions\n\tsize := m.Size()\n\tnRows := size[0]\n\n\t// calc determinant\n\tswitch nRows {\n\tcase 1:\n\t\tdet = m[0][0]\n\tcase 2:\n\t\tdet = m[0][0]*m[1][1] - m[0][1]*m[1][0]\n\tdefault:\n\t\tdet, err = nxnDet(m)\n\t}\n\n\treturn det, err\n}",
"func VCVTTSS2SI_SAE(x, r operand.Op) { ctx.VCVTTSS2SI_SAE(x, r) }",
"func VCVTSS2SD_SAE_Z(x, x1, k, x2 operand.Op) { ctx.VCVTSS2SD_SAE_Z(x, x1, k, x2) }",
"func (t *Trace) EncodeAigerStim(dst io.Writer) (int, error) {\n\tsz := len(t.Inputs) + len(t.Latches) + len(t.Watches)\n\tN := len(t.values)\n\tnIn := len(t.Inputs)\n\tbuf := make([]byte, nIn+1)\n\tvals := t.values\n\tttl := 0\n\tvar n int\n\tvar err error\n\tfor i := 0; i < N; i += sz {\n\t\tfor j := range buf {\n\t\t\tif vals[i+j] {\n\t\t\t\tbuf[j] = byte('1')\n\t\t\t} else {\n\t\t\t\tbuf[j] = byte('0')\n\t\t\t}\n\t\t}\n\t\tbuf[nIn] = byte('\\n')\n\t\tn, err = dst.Write(buf)\n\t\tttl += n\n\t\tif err != nil {\n\t\t\treturn ttl, err\n\t\t}\n\t}\n\tbuf[0] = byte('.')\n\tbuf[1] = byte('\\n')\n\tn, err = dst.Write(buf[:2])\n\tttl += n\n\treturn ttl, err\n}",
"func zchkgk(t *testing.T) {\n\tvar cone, czero complex128\n\tvar anorm, bnorm, eps, rmax, vmax, zero float64\n\tvar _i, i, ihi, ilo, j, knt, ldwork, m, n, ninfo int\n\tvar err error\n\n\tldwork = 50\n\tzero = 0.0\n\tczero = (0.0 + 0.0*1i)\n\tcone = (1.0 + 0.0*1i)\n\n\tlscale := vf(50)\n\trscale := vf(50)\n\trwork := vf(ldwork)\n\tlmax := make([]int, 4)\n\ta := cmf(50, 50, opts)\n\taf := cmf(50, 50, opts)\n\tb := cmf(50, 50, opts)\n\tbf := cmf(50, 50, opts)\n\te := cmf(50, 50, opts)\n\tf := cmf(50, 50, opts)\n\tvl := cmf(50, 50, opts)\n\tvlf := cmf(50, 50, opts)\n\tvr := cmf(50, 50, opts)\n\tvrf := cmf(50, 50, opts)\n\twork := cmf(50, 50, opts)\n\n\tlmax[0] = 0\n\tlmax[1] = 0\n\tlmax[2] = 0\n\tlmax[3] = 0\n\tninfo = 0\n\tknt = 0\n\trmax = zero\n\n\teps = golapack.Dlamch(Precision)\n\n\tnlist := []int{6, 6, 6, 5, 6, 6, 7, 7, 6, 6}\n\tmlist := []int{3, 2, 3, 3, 3, 3, 2, 3, 3, 3}\n\talist := [][]complex128{\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.2000e+01 + 0.2000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.3000e+01 + 0.3000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.4000e+01 + 0.4000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.5000e+01 + 0.5000e+01i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.6000e+01 + 0.6000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.2000e+01 + 0.2000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.2000e+01 + 0.2000e+01i, 0.3000e+01 + 0.3000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.2000e+01 + 0.2000e+01i, 0.3000e+01 + 0.3000e+01i, 0.4000e+01 + 0.4000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.2000e+01 + 0.2000e+01i, 0.3000e+01 + 0.3000e+01i, 0.4000e+01 + 0.4000e+01i, 0.5000e+01 + 0.5000e+01i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.2000e+01 + 0.2000e+01i, 0.3000e+01 + 0.3000e+01i, 0.4000e+01 + 0.4000e+01i, 0.5000e+01 + 0.5000e+01i, 0.6000e+01 + 0.6000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.2000e+01 + 0.2000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.2000e+01 + 0.2000e+01i, 0.3000e+01 + 0.3000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.2000e+01 + 0.2000e+01i, 0.3000e+01 + 0.3000e+01i, 0.4000e+01 + 0.4000e+01i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.2000e+01 + 0.2000e+01i, 0.3000e+01 + 0.3000e+01i, 0.4000e+01 + 0.4000e+01i, 0.5000e+01 + 0.5000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i,\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i,\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i,\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i,\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+12 + 0.1000e+12i,\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i,\n\t\t\t0.1000e+07 + 0.1000e+07i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e-05 + 0.1000e-05i, 0.1000e+07 + 0.1000e+07i,\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i,\n\t\t\t0.1000e+07 + 0.1000e+07i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e-05 + 0.1000e-05i, 0.1000e-05 + 0.1000e-05i,\n\t\t\t0.1000e+07 + 0.1000e+07i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+07 + 0.1000e+07i, 0.1000e+07 + 0.1000e+07i,\n\t\t},\n\t\t{\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+06 + 0.1000e+06i, 0.0000e+00 + 0.0000e+00i, 0.1000e+06 + 0.1000e+06i, 0.1000e+06 + 0.1000e+06i, 0.1000e+06 + 0.1000e+06i, 0.1000e-04 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e-04 + 0.1000e-04i, 0.1000e+06 + 0.1000e+06i, 0.1000e-03 + 0.1000e-03i, 0.1000e-04 + 0.0000e+00i, 0.1000e+06 + 0.1000e+06i, 0.1000e+06 + 0.1000e+06i,\n\t\t\t0.1000e+06 + 0.1000e+06i, 0.1000e+06 + 0.1000e+06i, 0.1000e-04 + 0.1000e-04i, 0.1000e+06 + 0.1000e+01i, 0.1000e+06 + 0.1000e+01i, 0.1000e+06 + 0.1000e+06i, 0.1000e+04 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e-03 + 0.1000e-04i, 0.0000e+00 + 0.0000e+00i, 0.1000e+00 + 0.1000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e-03 + 0.1000e-03i, 0.1000e+06 + 0.1000e+06i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+06 + 0.1000e+06i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e-04 + 0.1000e-04i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e-04 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+02 + 0.1000e+02i, 0.0000e+00 + 0.0000e+00i, 0.1000e+06 + 0.1000e+06i, 0.1000e+06 + 0.1000e+06i, 0.1000e-04 + 0.1000e-04i, 0.1000e+03 + 0.0000e+00i,\n\t\t},\n\t\t{\n\t\t\t-0.2000e+02 + 0.1000e+01i, -0.1000e+04 + 0.1000e+04i, -0.2000e+01 + 0.0000e+00i, -0.1000e+04 + 0.0000e+00i, -0.1000e+02 + 0.0000e+00i, -0.2000e+04 + 0.1000e+04i,\n\t\t\t0.6000e-04 + 0.0000e+00i, 0.4000e+01 + 0.0000e+00i, 0.6000e-02 + 0.0000e+00i, 0.2000e+03 + 0.0000e+00i, 0.3000e-04 + 0.0000e+00i, 0.3000e+02 + 0.0000e+00i,\n\t\t\t-0.2000e+00 + 0.0000e+00i, -0.3000e+03 + 0.0000e+00i, -0.4000e-01 + 0.0000e+00i, -0.1000e+04 + 0.1000e+04i, 0.0000e+00 + 0.0000e+00i, 0.3000e+04 + 0.1000e+04i,\n\t\t\t0.6000e-04 + 0.0000e+00i, 0.4000e-01 + 0.0000e+00i, 0.9000e-02 + 0.0000e+00i, 0.9000e+01 + 0.0000e+00i, 0.3000e-04 + 0.0000e+00i, 0.5000e+00 + 0.0000e+00i,\n\t\t\t0.6000e-01 + 0.0000e+00i, 0.5000e+02 + 0.0000e+00i, 0.8000e-04 + 0.0000e+00i, -0.4000e+04 + 0.0000e+00i, 0.8000e-01 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+04 + 0.1000e+04i, 0.7000e+00 + 0.0000e+00i, -0.2000e+04 + 0.1000e+04i, 0.1300e+02 + 0.0000e+00i, -0.6000e+04 + 0.1000e+04i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i,\n\t\t},\n\t}\n\tblist := [][]complex128{\n\t\t{\n\t\t\t0.6000e+01 + 0.6000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.5000e+01 + 0.5000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.4000e+01 + 0.4000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.3000e+01 + 0.3000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.2000e+01 + 0.2000e+01i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.2000e+01 + 0.2000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.2000e+01 + 0.2000e+01i, 0.3000e+01 + 0.3000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.2000e+01 + 0.2000e+01i, 0.3000e+01 + 0.3000e+01i, 0.4000e+01 + 0.4000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.2000e+01 + 0.2000e+01i, 0.3000e+01 + 0.3000e+01i, 0.4000e+01 + 0.4000e+01i, 0.5000e+01 + 0.5000e+01i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.2000e+01 + 0.2000e+01i, 0.3000e+01 + 0.3000e+01i, 0.4000e+01 + 0.4000e+01i, 0.5000e+01 + 0.5000e+01i, 0.6000e+01 + 0.6000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i,\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i,\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i,\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+12 + 0.1000e+12i, 0.1000e+12 + 0.1000e+12i,\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+12 + 0.1000e+12i,\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i,\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i,\n\t\t\t0.1000e+07 + 0.1000e+07i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e-05 + 0.1000e-05i, 0.1000e+07 + 0.1000e+07i,\n\t\t\t0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i,\n\t\t\t0.1000e+07 + 0.1000e+07i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e-05 + 0.1000e-05i, 0.1000e-05 + 0.1000e-05i,\n\t\t\t0.1000e+07 + 0.1000e+07i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+07 + 0.1000e+07i, 0.1000e+07 + 0.1000e+07i,\n\t\t},\n\t\t{\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e-01 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+06 + 0.1000e+06i, 0.1000e-04 + 0.0000e+00i, 0.1000e+06 + 0.1000e+06i, 0.1000e+06 + 0.1000e+06i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+06 + 0.1000e+06i, 0.1000e+01 + 0.0000e+00i, 0.1000e+06 + 0.1000e+06i, 0.1000e+06 + 0.1000e+06i, 0.1000e+00 + 0.0000e+00i, 0.1000e+03 + 0.0000e+00i,\n\t\t\t0.1000e+06 + 0.1000e+06i, 0.1000e+03 + 0.0000e+00i, 0.1000e+04 + 0.0000e+00i, 0.1000e+04 + 0.0000e+00i, 0.1000e-03 + 0.1000e-04i, 0.1000e+01 + 0.0000e+00i, 0.1000e+01 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e-04 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+06 + 0.1000e+06i, 0.1000e+06 + 0.1000e+06i, 0.1000e+06 + 0.1000e+06i, 0.1000e+06 + 0.1000e+06i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+06 + 0.1000e+06i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e+06 + 0.1000e+06i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+06 + 0.1000e+06i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.1000e-03 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+06 + 0.1000e+06i, 0.1000e+06 + 0.1000e+06i, 0.1000e+06 + 0.1000e+06i, 0.1000e-03 + 0.1000e-04i,\n\t\t},\n\t\t{\n\t\t\t-0.2000e+02 + 0.0000e+00i, -0.1000e+04 + 0.1000e+04i, 0.2000e+01 + 0.0000e+00i, -0.2000e+04 + 0.0000e+00i, 0.1000e+02 + 0.0000e+00i, -0.1000e+04 + 0.1000e+04i,\n\t\t\t0.5000e-04 + 0.0000e+00i, 0.3000e+01 + 0.0000e+00i, -0.2000e-02 + 0.0000e+00i, 0.4000e+03 + 0.0000e+00i, -0.1000e-04 + 0.0000e+00i, 0.3000e+02 + 0.0000e+00i,\n\t\t\t0.0000e+00 + 0.0000e+00i, -0.1000e+03 + 0.0000e+00i, -0.8000e-01 + 0.0000e+00i, 0.2000e+04 + 0.0000e+00i, -0.4000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i,\n\t\t\t0.5000e-04 + 0.0000e+00i, 0.3000e-01 + 0.0000e+00i, 0.2000e-02 + 0.0000e+00i, 0.4000e+01 + 0.0000e+00i, 0.2000e-04 + 0.0000e+00i, 0.1000e+00 + 0.0000e+00i,\n\t\t\t0.4000e-01 + 0.0000e+00i, 0.3000e+02 + 0.0000e+00i, -0.1000e-04 + 0.0000e+00i, 0.3000e+04 + 0.0000e+00i, -0.1000e-01 + 0.0000e+00i, 0.6000e+03 + 0.0000e+00i,\n\t\t\t-0.1000e+01 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.4000e+00 + 0.0000e+00i, -0.1000e+04 + 0.1000e+04i, 0.4000e+01 + 0.0000e+00i, 0.2000e+04 + 0.0000e+00i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.0000e+00 + 0.0000e+00i, 0.1000e+01 + 0.1000e+01i, 0.0000e+00 + 0.0000e+00i,\n\t\t},\n\t}\n\tvllist := [][]complex128{\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.2000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.3000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.4000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.5000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.6000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.2000e+01 + 0.2000e+01i, 0.2000e+01 + 0.2000e+01i,\n\t\t\t0.3000e+01 + 0.3000e+01i, 0.3000e+01 + 0.3000e+01i,\n\t\t\t0.4000e+01 + 0.4000e+01i, 0.4000e+01 + 0.4000e+01i,\n\t\t\t0.5000e+01 + 0.5000e+01i, 0.5000e+01 + 0.5000e+01i,\n\t\t\t0.6000e+01 + 0.6000e+01i, 0.6000e+01 + 0.6000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.2000e+01 + 0.2000e+01i, 0.2000e+01 + 0.2000e+01i, 0.2000e+01 + 0.2000e+01i,\n\t\t\t0.3000e+01 + 0.3000e+01i, 0.3000e+01 + 0.3000e+01i, 0.3000e+01 + 0.3000e+01i,\n\t\t\t0.4000e+01 + 0.4000e+01i, 0.4000e+01 + 0.4000e+01i, 0.4000e+01 + 0.4000e+01i,\n\t\t\t0.5000e+01 + 0.5000e+01i, 0.5000e+01 + 0.5000e+01i, 0.5000e+01 + 0.5000e+01i,\n\t\t\t0.6000e+01 + 0.6000e+01i, 0.6000e+01 + 0.6000e+01i, 0.6000e+01 + 0.6000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.2000e+01 + 0.2000e+01i, 0.2000e+01 + 0.2000e+01i, 0.2000e+01 + 0.2000e+01i,\n\t\t\t0.3000e+01 + 0.3000e+01i, 0.3000e+01 + 0.3000e+01i, 0.3000e+01 + 0.3000e+01i,\n\t\t\t0.4000e+01 + 0.4000e+01i, 0.4000e+01 + 0.4000e+01i, 0.4000e+01 + 0.4000e+01i,\n\t\t\t0.5000e+01 + 0.5000e+01i, 0.5000e+01 + 0.5000e+01i, 0.5000e+01 + 0.5000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+05 + 0.1000e+05i, 0.1000e+05 + 0.1000e+05i, 0.1000e+05 + 0.1000e+05i,\n\t\t\t0.2000e+05 + 0.2000e+05i, 0.2000e+05 + 0.2000e+05i, 0.2000e+05 + 0.2000e+05i,\n\t\t\t0.3000e+05 + 0.3000e+05i, 0.3000e+05 + 0.3000e+05i, 0.3000e+05 + 0.3000e+05i,\n\t\t\t0.4000e+05 + 0.4000e+05i, 0.4000e+05 + 0.4000e+05i, 0.4000e+05 + 0.4000e+05i,\n\t\t\t0.5000e+05 + 0.5000e+05i, 0.5000e+05 + 0.5000e+05i, 0.5000e+05 + 0.5000e+05i,\n\t\t\t0.6000e+05 + 0.6000e+05i, 0.6000e+05 + 0.6000e+05i, 0.6000e+05 + 0.6000e+05i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.2000e+01 + 0.2000e+01i, 0.2000e+01 + 0.2000e+01i, 0.2000e+01 + 0.2000e+01i,\n\t\t\t0.3000e+01 + 0.3000e+01i, 0.3000e+01 + 0.3000e+01i, 0.3000e+01 + 0.3000e+01i,\n\t\t\t0.4000e+01 + 0.4000e+01i, 0.4000e+01 + 0.4000e+01i, 0.4000e+01 + 0.4000e+01i,\n\t\t\t0.5000e+01 + 0.5000e+01i, 0.5000e+01 + 0.5000e+01i, 0.5000e+01 + 0.5000e+01i,\n\t\t\t0.6000e+01 + 0.6000e+01i, 0.6000e+01 + 0.6000e+01i, 0.6000e+01 + 0.6000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.2000e+01 + 0.2000e+01i, 0.2000e+01 + 0.2000e+01i,\n\t\t\t0.3000e+01 + 0.3000e+01i, 0.3000e+01 + 0.3000e+01i,\n\t\t\t0.4000e+01 + 0.4000e+01i, 0.4000e+01 + 0.4000e+01i,\n\t\t\t0.5000e+01 + 0.5000e+01i, 0.5000e+01 + 0.5000e+01i,\n\t\t\t0.6000e+01 + 0.6000e+01i, 0.6000e+01 + 0.6000e+01i,\n\t\t\t0.7000e+01 + 0.7000e+01i, 0.7000e+01 + 0.7000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e-04 + 0.1000e-04i, 0.1000e-04 + 0.1000e-04i, 0.1000e-04 + 0.1000e-04i,\n\t\t\t0.2000e-04 + 0.2000e-04i, 0.2000e-04 + 0.2000e-04i, 0.2000e-04 + 0.2000e-04i,\n\t\t\t0.3000e-04 + 0.3000e-04i, 0.3000e-04 + 0.3000e-04i, 0.3000e-04 + 0.3000e-04i,\n\t\t\t0.4000e-04 + 0.4000e-04i, 0.4000e-04 + 0.4000e-04i, 0.4000e-04 + 0.4000e-04i,\n\t\t\t0.5000e-04 + 0.5000e-04i, 0.5000e-04 + 0.5000e-04i, 0.5000e-04 + 0.5000e-04i,\n\t\t\t0.6000e-04 + 0.6000e-04i, 0.6000e-04 + 0.6000e-04i, 0.6000e-04 + 0.6000e-04i,\n\t\t\t0.7000e-04 + 0.7000e-04i, 0.7000e-04 + 0.7000e-04i, 0.7000e-04 + 0.7000e-04i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t},\n\t\t{\n\t\t\t0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t0.2000e+01 + 0.2000e+01i, 0.2000e+01 + 0.2000e+01i, 0.2000e+01 + 0.2000e+01i,\n\t\t\t0.3000e+01 + 0.3000e+01i, 0.3000e+01 + 0.3000e+01i, 0.3000e+01 + 0.3000e+01i,\n\t\t\t0.4000e+01 + 0.4000e+01i, 0.4000e+01 + 0.4000e+01i, 0.4000e+01 + 0.4000e+01i,\n\t\t\t0.5000e+01 + 0.5000e+01i, 0.5000e+01 + 0.5000e+01i, 0.5000e+01 + 0.5000e+01i,\n\t\t\t0.6000e+01 + 0.6000e+01i, 0.6000e+01 + 0.6000e+01i, 0.6000e+01 + 0.6000e+01i,\n\t\t},\n\t}\n\tvrlist := [][]complex128{\n\t\t{\n\t\t\t-0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t-0.2000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t-0.3000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t-0.4000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t-0.5000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t\t-0.6000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i, 0.1000e+01 + 0.1000e+01i,\n\t\t},\n\t\t{\n\t\t\t-0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i,\n\t\t\t-0.2000e+01 + -0.2000e+01i, -0.2000e+01 + -0.2000e+01i,\n\t\t\t-0.3000e+01 + -0.3000e+01i, -0.3000e+01 + -0.3000e+01i,\n\t\t\t-0.4000e+01 + -0.4000e+01i, -0.4000e+01 + -0.4000e+01i,\n\t\t\t-0.5000e+01 + -0.5000e+01i, -0.5000e+01 + -0.5000e+01i,\n\t\t\t-0.6000e+01 + -0.6000e+01i, -0.6000e+01 + -0.6000e+01i,\n\t\t},\n\t\t{\n\t\t\t-0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i,\n\t\t\t-0.2000e+01 + -0.2000e+01i, -0.2000e+01 + -0.2000e+01i, -0.2000e+01 + -0.2000e+01i,\n\t\t\t-0.3000e+01 + -0.3000e+01i, -0.3000e+01 + -0.3000e+01i, -0.3000e+01 + -0.3000e+01i,\n\t\t\t-0.4000e+01 + -0.4000e+01i, -0.4000e+01 + -0.4000e+01i, -0.4000e+01 + -0.4000e+01i,\n\t\t\t-0.5000e+01 + -0.5000e+01i, -0.5000e+01 + -0.5000e+01i, -0.5000e+01 + -0.5000e+01i,\n\t\t\t-0.6000e+01 + -0.6000e+01i, -0.6000e+01 + -0.6000e+01i, -0.6000e+01 + -0.6000e+01i,\n\t\t},\n\t\t{\n\t\t\t-0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i,\n\t\t\t-0.2000e+01 + -0.2000e+01i, -0.2000e+01 + -0.2000e+01i, -0.2000e+01 + -0.2000e+01i,\n\t\t\t-0.3000e+01 + -0.3000e+01i, -0.3000e+01 + -0.3000e+01i, -0.3000e+01 + -0.3000e+01i,\n\t\t\t-0.4000e+01 + -0.4000e+01i, -0.4000e+01 + -0.4000e+01i, -0.4000e+01 + -0.4000e+01i,\n\t\t\t-0.5000e+01 + -0.5000e+01i, -0.5000e+01 + -0.5000e+01i, -0.5000e+01 + -0.5000e+01i,\n\t\t},\n\t\t{\n\t\t\t-0.1000e+05 + -0.1000e+05i, -0.1000e+05 + -0.1000e+05i, -0.1000e+05 + -0.1000e+05i,\n\t\t\t-0.2000e+05 + -0.2000e+05i, -0.2000e+05 + -0.2000e+05i, -0.2000e+05 + -0.2000e+05i,\n\t\t\t-0.3000e+05 + -0.3000e+05i, -0.3000e+05 + -0.3000e+05i, -0.3000e+05 + -0.3000e+05i,\n\t\t\t-0.4000e+05 + -0.4000e+05i, -0.4000e+05 + -0.4000e+05i, -0.4000e+05 + -0.4000e+05i,\n\t\t\t-0.5000e+05 + -0.5000e+05i, -0.5000e+05 + -0.5000e+05i, -0.5000e+05 + -0.5000e+05i,\n\t\t\t-0.6000e+05 + -0.6000e+05i, -0.6000e+05 + -0.6000e+05i, -0.6000e+05 + -0.6000e+05i,\n\t\t},\n\t\t{\n\t\t\t-0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i,\n\t\t\t-0.2000e+01 + -0.2000e+01i, -0.2000e+01 + -0.2000e+01i, -0.2000e+01 + -0.2000e+01i,\n\t\t\t-0.3000e+01 + -0.3000e+01i, -0.3000e+01 + -0.3000e+01i, -0.3000e+01 + -0.3000e+01i,\n\t\t\t-0.4000e+01 + -0.4000e+01i, -0.4000e+01 + -0.4000e+01i, -0.4000e+01 + -0.4000e+01i,\n\t\t\t-0.5000e+01 + -0.5000e+01i, -0.5000e+01 + -0.5000e+01i, -0.5000e+01 + -0.5000e+01i,\n\t\t\t-0.6000e+01 + -0.6000e+01i, -0.6000e+01 + -0.6000e+01i, -0.6000e+01 + -0.6000e+01i,\n\t\t},\n\t\t{\n\t\t\t-0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i,\n\t\t\t-0.2000e+01 + -0.2000e+01i, -0.2000e+01 + -0.2000e+01i,\n\t\t\t-0.3000e+01 + -0.3000e+01i, -0.3000e+01 + -0.3000e+01i,\n\t\t\t-0.4000e+01 + -0.4000e+01i, -0.4000e+01 + -0.4000e+01i,\n\t\t\t-0.5000e+01 + -0.5000e+01i, -0.5000e+01 + -0.5000e+01i,\n\t\t\t-0.6000e+01 + -0.6000e+01i, -0.6000e+01 + -0.6000e+01i,\n\t\t\t-0.7000e+01 + -0.7000e+01i, -0.7000e+01 + -0.7000e+01i,\n\t\t},\n\t\t{\n\t\t\t-0.1000e-04 + -0.1000e-04i, -0.1000e-04 + -0.1000e-04i, -0.1000e-04 + -0.1000e-04i,\n\t\t\t-0.2000e-04 + -0.2000e-04i, -0.2000e-04 + -0.2000e-04i, -0.2000e-04 + -0.2000e-04i,\n\t\t\t-0.3000e-04 + -0.3000e-04i, -0.3000e-04 + -0.3000e-04i, -0.3000e-04 + -0.3000e-04i,\n\t\t\t-0.4000e-04 + -0.4000e-04i, -0.4000e-04 + -0.4000e-04i, -0.4000e-04 + -0.4000e-04i,\n\t\t\t-0.5000e-04 + -0.5000e-04i, -0.5000e-04 + -0.5000e-04i, -0.5000e-04 + -0.5000e-04i,\n\t\t\t-0.6000e-04 + -0.6000e-04i, -0.6000e-04 + -0.6000e-04i, -0.6000e-04 + -0.6000e-04i,\n\t\t\t-0.7000e-04 + -0.7000e-04i, -0.7000e-04 + -0.7000e-04i, -0.7000e-04 + -0.7000e-04i,\n\t\t},\n\t\t{\n\t\t\t-0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i,\n\t\t\t-0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i,\n\t\t\t-0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i,\n\t\t\t-0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i,\n\t\t\t-0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i,\n\t\t\t-0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i,\n\t\t},\n\t\t{\n\t\t\t-0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i, -0.1000e+01 + -0.1000e+01i,\n\t\t\t-0.2000e+01 + -0.2000e+01i, -0.2000e+01 + -0.2000e+01i, -0.2000e+01 + -0.2000e+01i,\n\t\t\t-0.3000e+01 + -0.3000e+01i, -0.3000e+01 + -0.3000e+01i, -0.3000e+01 + -0.3000e+01i,\n\t\t\t-0.4000e+01 + -0.4000e+01i, -0.4000e+01 + -0.4000e+01i, -0.4000e+01 + -0.4000e+01i,\n\t\t\t-0.5000e+01 + -0.5000e+01i, -0.5000e+01 + -0.5000e+01i, -0.5000e+01 + -0.5000e+01i,\n\t\t\t-0.6000e+01 + -0.6000e+01i, -0.6000e+01 + -0.6000e+01i, -0.6000e+01 + -0.6000e+01i,\n\t\t},\n\t}\n\n\tfor _i, n = range nlist {\n\t\tm = mlist[_i]\n\n\t\tfor i = 1; i <= n; i++ {\n\t\t\tfor j = 1; j <= n; j++ {\n\t\t\t\ta.Set(i-1, j-1, alist[_i][(i-1)*(n)+j-1])\n\t\t\t\tb.Set(i-1, j-1, blist[_i][(i-1)*(n)+j-1])\n\t\t\t}\n\t\t}\n\n\t\tfor i = 1; i <= n; i++ {\n\t\t\tfor j = 1; j <= m; j++ {\n\t\t\t\tvl.Set(i-1, j-1, vllist[_i][(i-1)*(m)+j-1])\n\t\t\t\tvr.Set(i-1, j-1, vrlist[_i][(i-1)*(m)+j-1])\n\t\t\t}\n\t\t}\n\n\t\tknt = knt + 1\n\n\t\tanorm = golapack.Zlange('M', n, n, a, rwork)\n\t\tbnorm = golapack.Zlange('M', n, n, b, rwork)\n\n\t\tgolapack.Zlacpy(Full, n, n, a, af)\n\t\tgolapack.Zlacpy(Full, n, n, b, bf)\n\n\t\tif ilo, ihi, err = golapack.Zggbal('B', n, a, b, lscale, rscale, rwork); err != nil {\n\t\t\tninfo = ninfo + 1\n\t\t\tlmax[0] = knt\n\t\t}\n\n\t\tgolapack.Zlacpy(Full, n, m, vl, vlf)\n\t\tgolapack.Zlacpy(Full, n, m, vr, vrf)\n\n\t\tif err = golapack.Zggbak('B', Left, n, ilo, ihi, lscale, rscale, m, vl); err != nil {\n\t\t\tninfo = ninfo + 1\n\t\t\tlmax[1] = knt\n\t\t}\n\n\t\tif err = golapack.Zggbak('B', Right, n, ilo, ihi, lscale, rscale, m, vr); err != nil {\n\t\t\tninfo = ninfo + 1\n\t\t\tlmax[2] = knt\n\t\t}\n\n\t\t// Test of Zggbak\n\t\t//\n\t\t// Check tilde(VL)'*A*tilde(VR) - VL'*tilde(A)*VR\n\t\t// where tilde(A) denotes the transformed matrix.\n\t\terr = work.Gemm(NoTrans, NoTrans, n, m, n, cone, af, vr, czero)\n\t\terr = e.Gemm(ConjTrans, NoTrans, m, m, n, cone, vl, work, czero)\n\n\t\terr = work.Gemm(NoTrans, NoTrans, n, m, n, cone, a, vrf, czero)\n\t\terr = f.Gemm(ConjTrans, NoTrans, m, m, n, cone, vlf, work, czero)\n\n\t\tvmax = zero\n\t\tfor j = 1; j <= m; j++ {\n\t\t\tfor i = 1; i <= m; i++ {\n\t\t\t\tvmax = math.Max(vmax, cabs1(e.Get(i-1, j-1)-f.Get(i-1, j-1)))\n\t\t\t}\n\t\t}\n\t\tvmax = vmax / (eps * math.Max(anorm, bnorm))\n\t\tif vmax > rmax {\n\t\t\tlmax[3] = knt\n\t\t\trmax = vmax\n\t\t}\n\n\t\t// Check tilde(VL)'*B*tilde(VR) - VL'*tilde(B)*VR\n\t\terr = work.Gemm(NoTrans, NoTrans, n, m, n, cone, bf, vr, czero)\n\t\terr = e.Gemm(ConjTrans, NoTrans, m, m, n, cone, vl, work, czero)\n\n\t\terr = work.Gemm(NoTrans, NoTrans, n, m, n, cone, b, vrf, czero)\n\t\terr = f.Gemm(ConjTrans, NoTrans, m, m, n, cone, vlf, work, czero)\n\n\t\tvmax = zero\n\t\tfor j = 1; j <= m; j++ {\n\t\t\tfor i = 1; i <= m; i++ {\n\t\t\t\tvmax = math.Max(vmax, cabs1(e.Get(i-1, j-1)-f.Get(i-1, j-1)))\n\t\t\t}\n\t\t}\n\t\tvmax = vmax / (eps * math.Max(anorm, bnorm))\n\t\tif vmax > rmax {\n\t\t\tlmax[3] = knt\n\t\t\trmax = vmax\n\t\t}\n\t}\n\n\tfmt.Printf(\" .. test output of Zggbak .. \\n\")\n\n\tfmt.Printf(\" value of largest test error =%12.3E\\n\", rmax)\n\tfmt.Printf(\" example number where Zggbal info is not 0 =%4d\\n\", lmax[0])\n\tfmt.Printf(\" example number where Zggbak(L) info is not 0 =%4d\\n\", lmax[1])\n\tfmt.Printf(\" example number where Zggbak(R) info is not 0 =%4d\\n\", lmax[2])\n\tfmt.Printf(\" example number having largest error =%4d\\n\", lmax[3])\n\tfmt.Printf(\" number of examples where info is not 0 =%4d\\n\", ninfo)\n\tfmt.Printf(\" total number of examples tested =%4d\\n\\n\", knt)\n}",
"func VGETMANTSS_SAE_Z(i, x, x1, k, x2 operand.Op) { ctx.VGETMANTSS_SAE_Z(i, x, x1, k, x2) }",
"func VMAXSD_SAE_Z(x, x1, k, x2 operand.Op) { ctx.VMAXSD_SAE_Z(x, x1, k, x2) }",
"func VGETEXPPD_SAE_Z(z, k, z1 operand.Op) { ctx.VGETEXPPD_SAE_Z(z, k, z1) }",
"func dqrt13(scale, m, n int, a *mat.Matrix, iseed []int) (float64, []int) {\n\tvar bignum, norma, one, smlnum float64\n\tvar j int\n\tvar err error\n\n\tdummy := vf(1)\n\n\tone = 1.0\n\n\tif m <= 0 || n <= 0 {\n\t\treturn norma, iseed\n\t}\n\n\t// benign matrix\n\tfor j = 1; j <= n; j++ {\n\t\tgolapack.Dlarnv(2, &iseed, m, a.Off(0, j-1).Vector())\n\t\tif j <= m {\n\t\t\ta.Set(j-1, j-1, a.Get(j-1, j-1)+math.Copysign(a.Off(0, j-1).Vector().Asum(m, 1), a.Get(j-1, j-1)))\n\t\t}\n\t}\n\n\t// scaled versions\n\tif scale != 1 {\n\t\tnorma = golapack.Dlange('M', m, n, a, dummy)\n\t\tsmlnum = golapack.Dlamch(SafeMinimum)\n\t\tbignum = one / smlnum\n\t\tsmlnum, bignum = golapack.Dlabad(smlnum, bignum)\n\t\tsmlnum = smlnum / golapack.Dlamch(Epsilon)\n\t\tbignum = one / smlnum\n\n\t\tif scale == 2 {\n\t\t\t// matrix scaled up\n\t\t\tif err = golapack.Dlascl('G', 0, 0, norma, bignum, m, n, a); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t} else if scale == 3 {\n\t\t\t// matrix scaled down\n\t\t\tif err = golapack.Dlascl('G', 0, 0, norma, smlnum, m, n, a); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t}\n\n\tnorma = golapack.Dlange('O', m, n, a, dummy)\n\n\treturn norma, iseed\n}",
"func (m *Matrix3) Det() float64 {\n\treturn m[0]*(m[4]*m[8]-m[5]*m[7]) - m[1]*(m[3]*m[8]-m[5]*m[6]) + m[2]*(m[3]*m[7]-m[4]*m[6])\n}",
"func VGETMANTPD_SAE_Z(i, z, k, z1 operand.Op) { ctx.VGETMANTPD_SAE_Z(i, z, k, z1) }",
"func zgbt02(trans mat.MatTrans, m, n, kl, ku, nrhs int, a, x, b *mat.CMatrix) (resid float64) {\n\tvar cone complex128\n\tvar anorm, bnorm, eps, one, xnorm, zero float64\n\tvar i1, i2, j, kd, n1 int\n\tvar err error\n\n\tzero = 0.0\n\tone = 1.0\n\tcone = (1.0 + 0.0*1i)\n\t// Quick return if N = 0 pr NRHS = 0\n\tif m <= 0 || n <= 0 || nrhs <= 0 {\n\t\tresid = zero\n\t\treturn\n\t}\n\n\t// Exit with RESID = 1/EPS if ANORM = 0.\n\teps = golapack.Dlamch(Epsilon)\n\tkd = ku + 1\n\tanorm = zero\n\tfor j = 1; j <= n; j++ {\n\t\ti1 = max(kd+1-j, 1)\n\t\ti2 = min(kd+m-j, kl+kd)\n\t\tanorm = math.Max(anorm, a.Off(i1-1, j-1).CVector().Asum(i2-i1+1, 1))\n\t}\n\tif anorm <= zero {\n\t\tresid = one / eps\n\t\treturn\n\t}\n\n\tif trans == Trans || trans == ConjTrans {\n\t\tn1 = n\n\t} else {\n\t\tn1 = m\n\t}\n\n\t// Compute B - A*X (or B - A'*X )\n\tfor j = 1; j <= nrhs; j++ {\n\t\tif err = b.Off(0, j-1).CVector().Gbmv(trans, m, n, kl, ku, -cone, a, x.Off(0, j-1).CVector(), 1, cone, 1); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\n\t// Compute the maximum over the number of right hand sides of\n\t// norm(B - A*X) / ( norm(A) * norm(X) * EPS ).\n\tresid = zero\n\tfor j = 1; j <= nrhs; j++ {\n\t\tbnorm = b.Off(0, j-1).CVector().Asum(n1, 1)\n\t\txnorm = x.Off(0, j-1).CVector().Asum(n1, 1)\n\t\tif xnorm <= zero {\n\t\t\tresid = one / eps\n\t\t} else {\n\t\t\tresid = math.Max(resid, ((bnorm/anorm)/xnorm)/eps)\n\t\t}\n\t}\n\n\treturn\n}",
"func SMS(DataA DiffData, LowerA, UpperA int, DataB DiffData, LowerB, UpperB int, DownVector []int, UpVector []int) SMSRD {\n\n\tMAX := DataA.Length + DataB.Length + 1\n\n\tDownK := LowerA - LowerB // the k-line to start the forward search\n\tUpK := UpperA - UpperB // the k-line to start the reverse search\n\n\tDelta := (UpperA - LowerA) - (UpperB - LowerB)\n\toddDelta := (Delta & 1) != 0\n\n\t// The vectors in the publication accepts negative indexes. the vectors implemented here are 0-based\n\t// and are access using a specific offset: UpOffset UpVector and DownOffset for DownVektor\n\tDownOffset := MAX - DownK\n\tUpOffset := MAX - UpK\n\n\tMaxD := ((UpperA - LowerA + UpperB - LowerB) / 2) + 1\n\n\t// Debug.Write(2, \"SMS\", String.Format(\"Search the box: A[{0}-{1}] to B[{2}-{3}]\", LowerA, UpperA, LowerB, UpperB))\n\n\t// init vectors\n\tDownVector[DownOffset+DownK+1] = LowerA\n\tUpVector[UpOffset+UpK-1] = UpperA\n\n\tfor D := 0; D <= MaxD; D++ {\n\n\t\t// Extend the forward path.\n\t\tfor k := DownK - D; k <= DownK+D; k += 2 {\n\t\t\t// Debug.Write(0, \"SMS\", \"extend forward path \" + k.ToString())\n\n\t\t\t// find the only or better starting point\n\t\t\tvar x, y int\n\t\t\tif k == DownK-D {\n\t\t\t\tx = DownVector[DownOffset+k+1] // down\n\t\t\t} else {\n\t\t\t\tx = DownVector[DownOffset+k-1] + 1 // a step to the right\n\t\t\t\tif (k < DownK+D) && (DownVector[DownOffset+k+1] >= x) {\n\t\t\t\t\tx = DownVector[DownOffset+k+1] // down\n\t\t\t\t}\n\t\t\t}\n\t\t\ty = x - k\n\n\t\t\t// find the end of the furthest reaching forward D-path in diagonal k.\n\t\t\tfor x < UpperA && (y < UpperB) && (DataA.data[x] == DataB.data[y]) {\n\t\t\t\tx++\n\t\t\t\ty++\n\t\t\t}\n\t\t\tDownVector[DownOffset+k] = x\n\n\t\t\t// overlap ?\n\t\t\tif oddDelta && (UpK-D < k) && (k < UpK+D) {\n\t\t\t\tif UpVector[UpOffset+k] <= DownVector[DownOffset+k] {\n\t\t\t\t\treturn SMSRD{\n\t\t\t\t\t\tx: DownVector[DownOffset+k],\n\t\t\t\t\t\ty: DownVector[DownOffset+k] - k,\n\t\t\t\t\t}\n\t\t\t\t} // if\n\t\t\t} // if\n\n\t\t} // for k\n\n\t\t// Extend the reverse path.\n\t\tfor k := UpK - D; k <= UpK+D; k += 2 {\n\t\t\t// Debug.Write(0, \"SMS\", \"extend reverse path \" + k.ToString())\n\n\t\t\t// find the only or better starting point\n\t\t\tvar x, y int\n\t\t\tif k == UpK+D {\n\t\t\t\tx = UpVector[UpOffset+k-1] // up\n\t\t\t} else {\n\t\t\t\tx = UpVector[UpOffset+k+1] - 1 // left\n\t\t\t\tif (k > UpK-D) && (UpVector[UpOffset+k-1] < x) {\n\t\t\t\t\tx = UpVector[UpOffset+k-1] // up\n\t\t\t\t}\n\t\t\t} // if\n\t\t\ty = x - k\n\n\t\t\tfor x > LowerA && (y > LowerB) && (DataA.data[x-1] == DataB.data[y-1]) {\n\t\t\t\tx--\n\t\t\t\ty-- // diagonal\n\t\t\t}\n\t\t\tUpVector[UpOffset+k] = x\n\n\t\t\t// overlap ?\n\t\t\tif !oddDelta && (DownK-D <= k) && (k <= DownK+D) {\n\t\t\t\tif UpVector[UpOffset+k] <= DownVector[DownOffset+k] {\n\t\t\t\t\t// ret.u = UpVector[UpOffset + k] // 2002.09.20: no need for 2 points\n\t\t\t\t\t// ret.v = UpVector[UpOffset + k] - k\n\t\t\t\t\treturn SMSRD{\n\t\t\t\t\t\tx: DownVector[DownOffset+k],\n\t\t\t\t\t\ty: DownVector[DownOffset+k] - k,\n\t\t\t\t\t}\n\t\t\t\t} // if\n\t\t\t} // if\n\n\t\t} // for k\n\n\t} // for D\n\n\tpanic(\"the algorithm should never come here.\")\n}",
"func Benchmark_Dij_Dense(b *testing.B) {\n\tg := NewUndirectedGraph(5000, -1, 0.2, 10, true)\n\tsc := rand.Intn(g.Size)\n\ttm := rand.Intn(g.Size)\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tMBP(g, sc, tm, \"Dijkstra\")\n\t}\n}",
"func (e *edm) calc() int {\n\tnormalize(e.z)\n\n\te.bestStat = math.Inf(-1)\n\te.tau = e.delta\n\ttau2 := 2 * e.delta\n\n\td := medianResolution(len(e.z))\n\te.ta = NewIntervalTree(d)\n\te.tb = NewIntervalTree(d)\n\te.tab = NewIntervalTree(d)\n\n\tfor i := 0; i < e.tau; i++ {\n\t\tfor j := i + 1; j < e.tau; j++ {\n\t\t\te.ta.Insert(e.z[i] - e.z[j])\n\t\t}\n\t}\n\n\tfor i := e.tau; i < tau2; i++ {\n\t\tfor j := i + 1; j < tau2; j++ {\n\t\t\te.tb.Insert(e.z[i] - e.z[j])\n\t\t}\n\t}\n\n\tfor i := 0; i < e.tau; i++ {\n\t\tfor j := e.tau; j < tau2; j++ {\n\t\t\te.tab.Insert(e.z[i] - e.z[j])\n\t\t}\n\t}\n\n\ttau2 += 1\n\tfor ; tau2 < len(e.z)+1; tau2++ {\n\t\te.tb.Insert(e.z[tau2-1] - e.z[tau2-2])\n\t\te.stat(tau2)\n\t}\n\n\tforward := false\n\tfor e.tau < len(e.z)-e.delta {\n\t\tif forward {\n\t\t\te.forwardUpdate()\n\t\t} else {\n\t\t\te.backwardUpdate()\n\t\t}\n\t\tforward = !forward\n\t}\n\n\treturn e.bestIdx\n}",
"func ZhetrsAa2stage(uplo mat.MatUplo, n, nrhs int, a *mat.CMatrix, tb *mat.CVector, ltb int, ipiv, ipiv2 *[]int, b *mat.CMatrix) (err error) {\n\tvar upper bool\n\tvar one complex128\n\tvar ldtb, nb int\n\n\tone = (1.0 + 0.0*1i)\n\n\tupper = uplo == Upper\n\tif !upper && uplo != Lower {\n\t\terr = fmt.Errorf(\"!upper && uplo != Lower: uplo=%s\", uplo)\n\t} else if n < 0 {\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if nrhs < 0 {\n\t\terr = fmt.Errorf(\"nrhs < 0: nrhs=%v\", nrhs)\n\t} else if a.Rows < max(1, n) {\n\t\terr = fmt.Errorf(\"a.Rows < max(1, n): a.Rows=%v, n=%v\", a.Rows, n)\n\t} else if ltb < (4 * n) {\n\t\terr = fmt.Errorf(\"ltb < (4 * n): ltb=%v, n=%v\", ltb, n)\n\t} else if b.Rows < max(1, n) {\n\t\terr = fmt.Errorf(\"b.Rows < max(1, n): b.Rows=%v, n=%v\", b.Rows, n)\n\t}\n\tif err != nil {\n\t\tgltest.Xerbla2(\"ZhetrsAa2stage\", err)\n\t\treturn\n\t}\n\n\t// Quick return if possible\n\tif n == 0 || nrhs == 0 {\n\t\treturn\n\t}\n\n\t// Read NB and compute LDTB\n\tnb = int(tb.GetRe(0))\n\tldtb = ltb / n\n\n\tif upper {\n\t\t// Solve A*X = B, where A = U**H*T*U.\n\t\tif n > nb {\n\t\t\t// Pivot, P**T * B -> B\n\t\t\tZlaswp(nrhs, b, nb+1, n, ipiv, 1)\n\n\t\t\t// Compute (U**H \\ B) -> B [ (U**H \\P**T * B) ]\n\t\t\tif err = b.Off(nb, 0).Trsm(Left, Upper, ConjTrans, Unit, n-nb, nrhs, one, a.Off(0, nb)); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t}\n\n\t\t// Compute T \\ B -> B [ T \\ (U**H \\P**T * B) ]\n\t\tif err = Zgbtrs(NoTrans, n, nb, nb, nrhs, tb.CMatrix(ldtb, opts), ipiv2, b); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif n > nb {\n\t\t\t// Compute (U \\ B) -> B [ U \\ (T \\ (U**H \\P**T * B) ) ]\n\t\t\tif err = b.Off(nb, 0).Trsm(Left, Upper, NoTrans, Unit, n-nb, nrhs, one, a.Off(0, nb)); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\t// Pivot, P * B -> B [ P * (U \\ (T \\ (U**H \\P**T * B) )) ]\n\t\t\tZlaswp(nrhs, b, nb+1, n, ipiv, -1)\n\n\t\t}\n\n\t} else {\n\t\t// Solve A*X = B, where A = L*T*L**H.\n\t\tif n > nb {\n\t\t\t// Pivot, P**T * B -> B\n\t\t\tZlaswp(nrhs, b, nb+1, n, ipiv, 1)\n\n\t\t\t// Compute (L \\ B) -> B [ (L \\P**T * B) ]\n\t\t\tif err = b.Off(nb, 0).Trsm(Left, Lower, NoTrans, Unit, n-nb, nrhs, one, a.Off(nb, 0)); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t}\n\n\t\t// Compute T \\ B -> B [ T \\ (L \\P**T * B) ]\n\t\tif err = Zgbtrs(NoTrans, n, nb, nb, nrhs, tb.CMatrix(ldtb, opts), ipiv2, b); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif n > nb {\n\t\t\t// Compute (L**H \\ B) -> B [ L**H \\ (T \\ (L \\P**T * B) ) ]\n\t\t\tif err = b.Off(nb, 0).Trsm(Left, Lower, ConjTrans, Unit, n-nb, nrhs, one, a.Off(nb, 0)); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\t// Pivot, P * B -> B [ P * (L**H \\ (T \\ (L \\P**T * B) )) ]\n\t\t\tZlaswp(nrhs, b, nb+1, n, ipiv, -1)\n\n\t\t}\n\t}\n\n\treturn\n}",
"func (_Ethdkg *EthdkgCallerSession) TDISPUTEEND() (*big.Int, error) {\n\treturn _Ethdkg.Contract.TDISPUTEEND(&_Ethdkg.CallOpts)\n}",
"func Benchmark_Dij_Sparse(b *testing.B) {\n\tg := NewUndirectedGraph(5000, 6, -1, 10, true)\n\tsc := rand.Intn(g.Size)\n\ttm := rand.Intn(g.Size)\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tMBP(g, sc, tm, \"Dijkstra\")\n\t}\n}",
"func (eval *evaluator) MultiplyByDiagMatrixBSGS(ctIn *Ciphertext, matrix PtDiagMatrix, PoolDecompQP []rlwe.PolyQP, ctOut *Ciphertext) {\n\n\t// N1*N2 = N\n\tN1 := matrix.N1\n\n\tringQ := eval.params.RingQ()\n\tringP := eval.params.RingP()\n\tringQP := rlwe.RingQP{RingQ: ringQ, RingP: ringP}\n\n\tlevelQ := utils.MinInt(ctOut.Level(), utils.MinInt(ctIn.Level(), matrix.Level))\n\tlevelP := len(ringP.Modulus) - 1\n\n\tQiOverF := eval.params.QiOverflowMargin(levelQ)\n\tPiOverF := eval.params.PiOverflowMargin(levelP)\n\n\t// Computes the rotations indexes of the non-zero rows of the diagonalized DFT matrix for the baby-step giang-step algorithm\n\n\tindex, rotations := bsgsIndex(matrix.Vec, 1<<matrix.LogSlots, matrix.N1)\n\n\tvar ctInTmp0, ctInTmp1 *ring.Poly\n\tif ctIn == ctOut {\n\t\tring.CopyValuesLvl(levelQ, ctIn.Value[0], eval.ctxpool.Value[0])\n\t\tring.CopyValuesLvl(levelQ, ctIn.Value[1], eval.ctxpool.Value[1])\n\t\tctInTmp0, ctInTmp1 = eval.ctxpool.Value[0], eval.ctxpool.Value[1]\n\t} else {\n\t\tctInTmp0, ctInTmp1 = ctIn.Value[0], ctIn.Value[1]\n\t}\n\n\t// Pre-rotates ciphertext for the baby-step giant-step algorithm, does not divide by P yet\n\tctInRotQP := eval.RotateHoistedNoModDownNew(levelQ, rotations, ctInTmp0, eval.PoolDecompQP)\n\n\t// Accumulator inner loop\n\ttmp0QP := eval.Pool[1]\n\ttmp1QP := eval.Pool[2]\n\n\t// Accumulator outer loop\n\tc0QP := eval.Pool[3]\n\tc1QP := eval.Pool[4]\n\n\t// Result in QP\n\tc0OutQP := rlwe.PolyQP{Q: ctOut.Value[0], P: eval.Pool[5].Q}\n\tc1OutQP := rlwe.PolyQP{Q: ctOut.Value[1], P: eval.Pool[5].P}\n\n\tringQ.MulScalarBigintLvl(levelQ, ctInTmp0, ringP.ModulusBigint, ctInTmp0) // P*c0\n\tringQ.MulScalarBigintLvl(levelQ, ctInTmp1, ringP.ModulusBigint, ctInTmp1) // P*c1\n\n\t// OUTER LOOP\n\tvar cnt0 int\n\tfor j := range index {\n\t\t// INNER LOOP\n\t\tvar cnt1 int\n\t\tfor _, i := range index[j] {\n\t\t\tif i == 0 {\n\t\t\t\tif cnt1 == 0 {\n\t\t\t\t\tringQ.MulCoeffsMontgomeryConstantLvl(levelQ, matrix.Vec[N1*j].Q, ctInTmp0, tmp0QP.Q)\n\t\t\t\t\tringQ.MulCoeffsMontgomeryConstantLvl(levelQ, matrix.Vec[N1*j].Q, ctInTmp1, tmp1QP.Q)\n\t\t\t\t\ttmp0QP.P.Zero()\n\t\t\t\t\ttmp1QP.P.Zero()\n\t\t\t\t} else {\n\t\t\t\t\tringQ.MulCoeffsMontgomeryConstantAndAddNoModLvl(levelQ, matrix.Vec[N1*j].Q, ctInTmp0, tmp0QP.Q)\n\t\t\t\t\tringQ.MulCoeffsMontgomeryConstantAndAddNoModLvl(levelQ, matrix.Vec[N1*j].Q, ctInTmp1, tmp1QP.Q)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif cnt1 == 0 {\n\t\t\t\t\tringQP.MulCoeffsMontgomeryConstantLvl(levelQ, levelP, matrix.Vec[N1*j+i], ctInRotQP[i][0], tmp0QP)\n\t\t\t\t\tringQP.MulCoeffsMontgomeryConstantLvl(levelQ, levelP, matrix.Vec[N1*j+i], ctInRotQP[i][1], tmp1QP)\n\t\t\t\t} else {\n\t\t\t\t\tringQP.MulCoeffsMontgomeryConstantAndAddNoModLvl(levelQ, levelP, matrix.Vec[N1*j+i], ctInRotQP[i][0], tmp0QP)\n\t\t\t\t\tringQP.MulCoeffsMontgomeryConstantAndAddNoModLvl(levelQ, levelP, matrix.Vec[N1*j+i], ctInRotQP[i][1], tmp1QP)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif cnt1%(QiOverF>>1) == (QiOverF>>1)-1 {\n\t\t\t\tringQ.ReduceLvl(levelQ, tmp0QP.Q, tmp0QP.Q)\n\t\t\t\tringQ.ReduceLvl(levelQ, tmp1QP.Q, tmp1QP.Q)\n\t\t\t}\n\n\t\t\tif cnt1%(PiOverF>>1) == (PiOverF>>1)-1 {\n\t\t\t\tringP.ReduceLvl(levelP, tmp0QP.P, tmp0QP.P)\n\t\t\t\tringP.ReduceLvl(levelP, tmp1QP.P, tmp1QP.P)\n\t\t\t}\n\n\t\t\tcnt1++\n\t\t}\n\n\t\tif cnt1%(QiOverF>>1) != 0 {\n\t\t\tringQ.ReduceLvl(levelQ, tmp0QP.Q, tmp0QP.Q)\n\t\t\tringQ.ReduceLvl(levelQ, tmp1QP.Q, tmp1QP.Q)\n\t\t}\n\n\t\tif cnt1%(PiOverF>>1) != 0 {\n\t\t\tringP.ReduceLvl(levelP, tmp0QP.P, tmp0QP.P)\n\t\t\tringP.ReduceLvl(levelP, tmp1QP.P, tmp1QP.P)\n\t\t}\n\n\t\t// If j != 0, then rotates ((tmp0QP.Q, tmp0QP.P), (tmp1QP.Q, tmp1QP.P)) by N1*j and adds the result on ((c0QP.Q, c0QP.P), (c1QP.Q, c1QP.P))\n\t\tif j != 0 {\n\n\t\t\t// Hoisting of the ModDown of sum(sum(phi(d1) * plaintext))\n\t\t\teval.Baseconverter.ModDownQPtoQNTT(levelQ, levelP, tmp1QP.Q, tmp1QP.P, tmp1QP.Q) // c1 * plaintext + sum(phi(d1) * plaintext) + phi(c1) * plaintext mod Q\n\n\t\t\tgalEl := eval.params.GaloisElementForColumnRotationBy(N1 * j)\n\n\t\t\trtk, generated := eval.rtks.Keys[galEl]\n\t\t\tif !generated {\n\t\t\t\tpanic(\"switching key not available\")\n\t\t\t}\n\n\t\t\tindex := eval.permuteNTTIndex[galEl]\n\n\t\t\ttmp1QP.Q.IsNTT = true\n\t\t\teval.SwitchKeysInPlaceNoModDown(levelQ, tmp1QP.Q, rtk, c0QP.Q, c0QP.P, c1QP.Q, c1QP.P) // Switchkey(P*phi(tmpRes_1)) = (d0, d1) in base QP\n\n\t\t\tringQP.AddLvl(levelQ, levelP, c0QP, tmp0QP, c0QP)\n\n\t\t\t// Outer loop rotations\n\t\t\tif cnt0 == 0 {\n\t\t\t\tringQP.PermuteNTTWithIndexLvl(levelQ, levelP, c0QP, index, c0OutQP)\n\t\t\t\tringQP.PermuteNTTWithIndexLvl(levelQ, levelP, c1QP, index, c1OutQP)\n\t\t\t} else {\n\t\t\t\tringQP.PermuteNTTWithIndexAndAddNoModLvl(levelQ, levelP, c0QP, index, c0OutQP)\n\t\t\t\tringQP.PermuteNTTWithIndexAndAddNoModLvl(levelQ, levelP, c1QP, index, c1OutQP)\n\t\t\t}\n\n\t\t\t// Else directly adds on ((c0QP.Q, c0QP.P), (c1QP.Q, c1QP.P))\n\t\t} else {\n\t\t\tif cnt0 == 0 {\n\t\t\t\tringQP.CopyValuesLvl(levelQ, levelP, tmp0QP, c0OutQP)\n\t\t\t\tringQP.CopyValuesLvl(levelQ, levelP, tmp1QP, c1OutQP)\n\t\t\t} else {\n\t\t\t\tringQP.AddNoModLvl(levelQ, levelP, c0OutQP, tmp0QP, c0OutQP)\n\t\t\t\tringQP.AddNoModLvl(levelQ, levelP, c1OutQP, tmp1QP, c1OutQP)\n\t\t\t}\n\t\t}\n\n\t\tif cnt0%QiOverF == QiOverF-1 {\n\t\t\tringQ.ReduceLvl(levelQ, ctOut.Value[0], ctOut.Value[0])\n\t\t\tringQ.ReduceLvl(levelQ, ctOut.Value[1], ctOut.Value[1])\n\t\t}\n\n\t\tif cnt0%PiOverF == PiOverF-1 {\n\t\t\tringP.ReduceLvl(levelP, c0OutQP.P, c0OutQP.P)\n\t\t\tringP.ReduceLvl(levelP, c1OutQP.P, c1OutQP.P)\n\t\t}\n\n\t\tcnt0++\n\t}\n\n\tif cnt0%QiOverF != 0 {\n\t\tringQ.ReduceLvl(levelQ, ctOut.Value[0], ctOut.Value[0])\n\t\tringQ.ReduceLvl(levelQ, ctOut.Value[1], ctOut.Value[1])\n\t}\n\n\tif cnt0%PiOverF != 0 {\n\t\tringP.ReduceLvl(levelP, c0OutQP.P, c0OutQP.P)\n\t\tringP.ReduceLvl(levelP, c1OutQP.P, c1OutQP.P)\n\t}\n\n\teval.Baseconverter.ModDownQPtoQNTT(levelQ, levelP, ctOut.Value[0], c0OutQP.P, ctOut.Value[0]) // sum(phi(c0 * P + d0_QP))/P\n\teval.Baseconverter.ModDownQPtoQNTT(levelQ, levelP, ctOut.Value[1], c1OutQP.P, ctOut.Value[1]) // sum(phi(d1_QP))/P\n\n\tctOut.Scale = matrix.Scale * ctIn.Scale\n\n\tctInRotQP = nil\n\truntime.GC()\n}",
"func VMAXSS_SAE_Z(x, x1, k, x2 operand.Op) { ctx.VMAXSS_SAE_Z(x, x1, k, x2) }",
"func (_Ethdkg *EthdkgCaller) TDISPUTEEND(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Ethdkg.contract.Call(opts, out, \"T_DISPUTE_END\")\n\treturn *ret0, err\n}",
"func VGETEXPSD_SAE(ops ...operand.Op) { ctx.VGETEXPSD_SAE(ops...) }",
"func SmithWatermanFull(seqPair *SeqPair, wm *WeightMatrix, gapPenalty int) *AlignResult {\n dp := make([][]int, len(seqPair.S1) + 1)\n\n for i := range dp {\n dp[i] = make([]int, len(seqPair.S2) + 1)\n }\n\n maxScore := 0\n maxPos := Point{}\n\n // Main part\n\n for row := 0; row < len(seqPair.S1); row += 1 {\n for col := 0; col < len(seqPair.S2); col += 1 {\n // dp indices are actually (row + 1, col + 1) because of dummy zero-indexed elements\n dp[row + 1][col + 1] = util.Max4(\n 0,\n dp[row + 1][col] + gapPenalty, /* left */\n dp[row][col + 1] + gapPenalty, /* top */\n dp[row][col] + seqPair.WeightIn(wm, row, col)) /* top-left */\n\n if maxScore < dp[row + 1][col + 1] {\n maxScore = dp[row + 1][col + 1]\n maxPos = Point{ col + 1, row + 1 }\n }\n }\n }\n\n //fmt.Println(\"TABLE:\")\n //for i, lst := range dp[1:] {\n // fmt.Printf(\"%-2v: %-3v\\n\", i, lst)\n //}\n //fmt.Println()\n\n // Recovery\n\n s1Builder := strings.Builder{}\n s2Builder := strings.Builder{}\n\n curPos := maxPos\n\n if curPos.X > 0 {\n for i := len(seqPair.S2) - 1; i > curPos.X - 1; i -= 1 {\n s1Builder.WriteByte('-')\n s2Builder.WriteByte(seqPair.S2[i])\n }\n }\n\n if curPos.Y > 0 {\n for i := len(seqPair.S1) - 1; i > curPos.Y - 1; i -= 1 {\n s1Builder.WriteByte(seqPair.S1[i])\n s2Builder.WriteByte('-')\n }\n }\n\n for curPos.X > 0 && curPos.Y > 0 {\n l := dp[curPos.Y][curPos.X - 1] + gapPenalty /* left */\n t := dp[curPos.Y - 1][curPos.X] + gapPenalty /* top */\n tl := dp[curPos.Y - 1][curPos.X - 1] + seqPair.WeightIn(wm, curPos.Y - 1, curPos.X - 1) /* top-left */\n\n max := util.Max4(0, l, t, tl)\n\n if max == 0 {\n break\n } else if max == l {\n s1Builder.WriteByte('-')\n s2Builder.WriteByte(seqPair.S2[curPos.X - 1])\n curPos.X -= 1\n } else if max == t {\n s1Builder.WriteByte(seqPair.S1[curPos.Y - 1])\n s2Builder.WriteByte('-')\n curPos.Y -= 1\n } else { /* max == tl */\n s1Builder.WriteByte(seqPair.S1[curPos.Y - 1])\n s2Builder.WriteByte(seqPair.S2[curPos.X - 1])\n curPos.X -= 1\n curPos.Y -= 1\n }\n }\n\n for curPos.X > 0 {\n s1Builder.WriteByte('-')\n s2Builder.WriteByte(seqPair.S2[curPos.X - 1])\n curPos.X -= 1\n }\n\n for curPos.Y > 0 {\n s1Builder.WriteByte(seqPair.S1[curPos.Y - 1])\n s2Builder.WriteByte('-')\n curPos.Y -= 1\n }\n\n s1Align := util.ReverseString(s1Builder.String())\n s2Align := util.ReverseString(s2Builder.String())\n\n s1AlignColored := strings.Builder{}\n s2AlignColored := strings.Builder{}\n\n for i := range s1Align {\n if s1Align[i] == '-' {\n s1AlignColored.WriteString(util.Colorify(\"-\", util.ColorBlue))\n s2AlignColored.WriteByte(s2Align[i])\n } else if s2Align[i] == '-' {\n s1AlignColored.WriteByte(s1Align[i])\n s2AlignColored.WriteString(util.Colorify(\"-\", util.ColorBlue))\n } else if s1Align[i] == s2Align[i] {\n s1AlignColored.WriteString(util.Colorify(string(s1Align[i]), util.ColorGreen))\n s2AlignColored.WriteString(util.Colorify(string(s2Align[i]), util.ColorGreen))\n } else {\n s1AlignColored.WriteString(util.Colorify(string(s1Align[i]), util.ColorRed))\n s2AlignColored.WriteString(util.Colorify(string(s2Align[i]), util.ColorRed))\n }\n }\n\n // Return result\n return &AlignResult{\n Score: maxScore,\n Align: s1AlignColored.String() + \"\\n\" + s2AlignColored.String(),\n }\n}",
"func (t TestCase) Solve() (trips TestResult) {\n\tboxStackHeights := make([]int, t.numBoxes)\n\n\tfor i := 0; i < t.numBoxes; i++ {\n\t\tboxStackHeights[i] = int(math.Ceil(50.0 / float64(t.weights[i])))\n\t}\n\n\tsort.Ints(boxStackHeights)\n\n\tfmt.Println(boxStackHeights)\n\n\tusedBoxes := 0\n\n\tfor i := 0; i < t.numBoxes; i++ {\n\t\tthisbox := boxStackHeights[i]\n\t\tif usedBoxes+thisbox <= t.numBoxes {\n\t\t\ttrips++\n\t\t\tusedBoxes += thisbox\n\t\t} else {\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}",
"func VGETEXPPS_SAE_Z(z, k, z1 operand.Op) { ctx.VGETEXPPS_SAE_Z(z, k, z1) }",
"func DpbtrsTest(t *testing.T, impl Dpbtrser) {\n\trnd := rand.New(rand.NewSource(1))\n\tfor _, n := range []int{0, 1, 2, 3, 4, 5, 65, 100, 129} {\n\t\tfor _, kd := range []int{0, (n + 1) / 4, (3*n - 1) / 4, (5*n + 1) / 4} {\n\t\t\tfor _, nrhs := range []int{0, 1, 2, 5} {\n\t\t\t\tfor _, uplo := range []blas.Uplo{blas.Upper, blas.Lower} {\n\t\t\t\t\tfor _, ldab := range []int{kd + 1, kd + 1 + 3} {\n\t\t\t\t\t\tfor _, ldb := range []int{max(1, nrhs), nrhs + 4} {\n\t\t\t\t\t\t\tdpbtrsTest(t, impl, rnd, uplo, n, kd, nrhs, ldab, ldb)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"func Benchmark_Dij_Heap_Dense(b *testing.B) {\n\tg := NewUndirectedGraph(5000, -1, 0.2, 10, true)\n\tsc := rand.Intn(g.Size)\n\ttm := rand.Intn(g.Size)\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tMBP(g, sc, tm, \"Dijkstra_Heap\")\n\t}\n}",
"func (_Ethdkg *EthdkgSession) TDISPUTEEND() (*big.Int, error) {\n\treturn _Ethdkg.Contract.TDISPUTEEND(&_Ethdkg.CallOpts)\n}",
"func (c *Context) VGETEXPSD_SAE_Z(x, x1, k, x2 operand.Op) {\n\tc.addinstruction(x86.VGETEXPSD_SAE_Z(x, x1, k, x2))\n}",
"func TestAddAndSubDegs(t *testing.T) {\n\tfor i := 0; i < 1000; i++ {\n\t\ta, b := uint(prg.Uint32()), uint(prg.Uint32())\n\t\tc, d := uint(prg.Uint32()), uint(prg.Uint32())\n\t\tif tmp, _ := addDegs([2]uint{a, b}, [2]uint{c, d}); tmp != [2]uint{a + c, b + d} {\n\t\t\tt.Errorf(\"addDegs({%d,%d},{%d,%d})=%v (Expected {%d,%d})\", a, b, c, d, tmp, a+c, b+d)\n\t\t}\n\t\ttmp, ok := subtractDegs([2]uint{a, b}, [2]uint{c, d})\n\t\tswitch {\n\t\tcase (a < c || b < d) && ok:\n\t\t\tt.Errorf(\n\t\t\t\t\"subtractDegs({%d,%d},{%d,%d}) signalled no error (Expected ok=false)\",\n\t\t\t\ta, b, c, d,\n\t\t\t)\n\t\tcase (a >= c && b >= d) && !ok:\n\t\t\tt.Errorf(\n\t\t\t\t\"subtractDegs({%d,%d},{%d,%d}) signalled an error (Expected ok=true)\",\n\t\t\t\ta, b, c, d,\n\t\t\t)\n\t\t}\n\t\tif tmp != [2]uint{a - c, b - d} && ok {\n\t\t\tt.Errorf(\n\t\t\t\t\"subtractDegs({%d,%d},{%d,%d})=%v, err (Expected {%d,%d})\",\n\t\t\t\ta, b, c, d, tmp, a-c, b-d,\n\t\t\t)\n\t\t}\n\t}\n}",
"func tTest(bTemplin bool, mtx1, mtx2 [][]formulaArg, c1, c2, r1, r2 int) (float64, float64, bool) {\n\tvar cnt1, cnt2, sum1, sumSqr1, sum2, sumSqr2 float64\n\tvar fVal formulaArg\n\tfor i := 0; i < c1; i++ {\n\t\tfor j := 0; j < r1; j++ {\n\t\t\tif fVal = mtx1[i][j]; fVal.Type == ArgNumber {\n\t\t\t\tsum1 += fVal.Number\n\t\t\t\tsumSqr1 += fVal.Number * fVal.Number\n\t\t\t\tcnt1++\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < c2; i++ {\n\t\tfor j := 0; j < r2; j++ {\n\t\t\tif fVal = mtx2[i][j]; fVal.Type == ArgNumber {\n\t\t\t\tsum2 += fVal.Number\n\t\t\t\tsumSqr2 += fVal.Number * fVal.Number\n\t\t\t\tcnt2++\n\t\t\t}\n\t\t}\n\t}\n\tif cnt1 < 2.0 || cnt2 < 2.0 {\n\t\treturn 0, 0, false\n\t}\n\tif bTemplin {\n\t\tfS1 := (sumSqr1 - sum1*sum1/cnt1) / (cnt1 - 1) / cnt1\n\t\tfS2 := (sumSqr2 - sum2*sum2/cnt2) / (cnt2 - 1) / cnt2\n\t\tif fS1+fS2 == 0 {\n\t\t\treturn 0, 0, false\n\t\t}\n\t\tc := fS1 / (fS1 + fS2)\n\t\treturn math.Abs(sum1/cnt1-sum2/cnt2) / math.Sqrt(fS1+fS2), 1 / (c*c/(cnt1-1) + (1-c)*(1-c)/(cnt2-1)), true\n\t}\n\tfS1 := (sumSqr1 - sum1*sum1/cnt1) / (cnt1 - 1)\n\tfS2 := (sumSqr2 - sum2*sum2/cnt2) / (cnt2 - 1)\n\treturn math.Abs(sum1/cnt1-sum2/cnt2) / math.Sqrt((cnt1-1)*fS1+(cnt2-1)*fS2) * math.Sqrt(cnt1*cnt2*(cnt1+cnt2-2)/(cnt1+cnt2)), cnt1 + cnt2 - 2, true\n}",
"func DetParallel(matrix [][]float64, tasksNum int) float64 {\n\n\t// the starting minor is the entire matrix, with all of its columns\n\tn := len(matrix)\n\tcolumnIndexes := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tcolumnIndexes[i] = i\n\t}\n\n\t// initialize the result and allocate memory to hold values of minors\n\tvar result float64 = 0.0\n\tminors := make([]float64, n)\n\tvar sgn float64 = 1.0\n\n\t// in order to calculate the determinant the minors must be calculated first,\n\t// each task calculates some of the minors\n\n\t// for each process holds assigned minor calculation tasks\n\ttasks := make([][]MinorCalcTask, tasksNum)\n\t// semaphore used to sync tasks\n\tvar wg sync.WaitGroup\n\twg.Add(tasksNum)\n\n\t// for each requored minor form a task and assign it to one of the processes\n\tfor idx, col := range columnIndexes {\n\t\t// prepare the task holding information needed to calculate the given minor\n\t\tminorCols := removeColumn(columnIndexes, col)\n\t\tminorCalcTask := MinorCalcTask{\n\t\t\tMatrix: matrix,\n\t\t\tColumnIndexes: minorCols,\n\t\t\tResultsHolder: &minors[idx],\n\t\t}\n\n\t\t// add this task to one of the processes, using round Robin policy\n\t\tpIdx := idx % tasksNum\n\t\ttasks[pIdx] = append(tasks[pIdx], minorCalcTask)\n\t}\n\n\t// start tasks to calculate minors (first task set is executed by the current process)\n\tfirstTask := tasks[0]\n\n\tfor _, calcTasks := range tasks[1:] {\n\t\tgo minorsCalculation(calcTasks, &wg)\n\t}\n\n\tminorsCalculation(firstTask, &wg)\n\n\t// wait for other tasks to finish calculating assigned minors\n\twg.Wait()\n\n\t// calculate the determinant\n\tfor j := 0; j < n; j++ {\n\t\tresult += sgn * matrix[0][columnIndexes[j]] * minors[j]\n\t\tsgn *= -1\n\t}\n\n\treturn result\n}",
"func VSQRTPD_RU_SAE_Z(z, k, z1 operand.Op) { ctx.VSQRTPD_RU_SAE_Z(z, k, z1) }",
"func Zpbstf(uplo mat.MatUplo, n, kd int, ab *mat.CMatrix) (info int, err error) {\n\tvar upper bool\n\tvar ajj, one, zero float64\n\tvar j, kld, km, m int\n\n\tone = 1.0\n\tzero = 0.0\n\n\t// Test the input parameters.\n\tupper = uplo == Upper\n\tif !upper && uplo != Lower {\n\t\terr = fmt.Errorf(\"!upper && uplo != Lower: uplo=%s\", uplo)\n\t} else if n < 0 {\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if kd < 0 {\n\t\terr = fmt.Errorf(\"kd < 0: kd=%v\", kd)\n\t} else if ab.Rows < kd+1 {\n\t\terr = fmt.Errorf(\"ab.Rows < kd+1: ab.Rows=%v, kd=%v\", ab.Rows, kd)\n\t}\n\tif err != nil {\n\t\tgltest.Xerbla2(\"Zpbstf\", err)\n\t\treturn\n\t}\n\n\t// Quick return if possible\n\tif n == 0 {\n\t\treturn\n\t}\n\n\tkld = max(1, ab.Rows-1)\n\n\t// Set the splitting point m.\n\tm = (n + kd) / 2\n\n\tif upper {\n\t\t// Factorize A(m+1:n,m+1:n) as L**H*L, and update A(1:m,1:m).\n\t\tfor j = n; j >= m+1; j-- {\n\t\t\t// Compute s(j,j) and test for non-positive-definiteness.\n\t\t\tajj = ab.GetRe(kd, j-1)\n\t\t\tif ajj <= zero {\n\t\t\t\tab.SetRe(kd, j-1, ajj)\n\t\t\t\tgoto label50\n\t\t\t}\n\t\t\tajj = math.Sqrt(ajj)\n\t\t\tab.SetRe(kd, j-1, ajj)\n\t\t\tkm = min(j-1, kd)\n\n\t\t\t// Compute elements j-km:j-1 of the j-th column and update the\n\t\t\t// the leading submatrix within the band.\n\t\t\tab.Off(kd+1-km-1, j-1).CVector().Dscal(km, one/ajj, 1)\n\t\t\tif err = ab.Off(kd, j-km-1).UpdateRows(kld).Her(Upper, km, -one, ab.Off(kd+1-km-1, j-1).CVector(), 1); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\n\t\t// Factorize the updated submatrix A(1:m,1:m) as U**H*U.\n\t\tfor j = 1; j <= m; j++ {\n\t\t\t// Compute s(j,j) and test for non-positive-definiteness.\n\t\t\tajj = ab.GetRe(kd, j-1)\n\t\t\tif ajj <= zero {\n\t\t\t\tab.SetRe(kd, j-1, ajj)\n\t\t\t\tgoto label50\n\t\t\t}\n\t\t\tajj = math.Sqrt(ajj)\n\t\t\tab.SetRe(kd, j-1, ajj)\n\t\t\tkm = min(kd, m-j)\n\n\t\t\t// Compute elements j+1:j+km of the j-th row and update the\n\t\t\t// trailing submatrix within the band.\n\t\t\tif km > 0 {\n\t\t\t\tab.Off(kd-1, j).CVector().Dscal(km, one/ajj, kld)\n\t\t\t\tZlacgv(km, ab.Off(kd-1, j).CVector(), kld)\n\t\t\t\tif err = ab.Off(kd, j).UpdateRows(kld).Her(Upper, km, -one, ab.Off(kd-1, j).CVector(), kld); err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\t\t\t\tZlacgv(km, ab.Off(kd-1, j).CVector(), kld)\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Factorize A(m+1:n,m+1:n) as L**H*L, and update A(1:m,1:m).\n\t\tfor j = n; j >= m+1; j-- {\n\t\t\t// Compute s(j,j) and test for non-positive-definiteness.\n\t\t\tajj = ab.GetRe(0, j-1)\n\t\t\tif ajj <= zero {\n\t\t\t\tab.SetRe(0, j-1, ajj)\n\t\t\t\tgoto label50\n\t\t\t}\n\t\t\tajj = math.Sqrt(ajj)\n\t\t\tab.SetRe(0, j-1, ajj)\n\t\t\tkm = min(j-1, kd)\n\n\t\t\t// Compute elements j-km:j-1 of the j-th row and update the\n\t\t\t// trailing submatrix within the band.\n\t\t\tab.Off(km, j-km-1).CVector().Dscal(km, one/ajj, kld)\n\t\t\tZlacgv(km, ab.Off(km, j-km-1).CVector(), kld)\n\t\t\tif err = ab.Off(0, j-km-1).UpdateRows(kld).Her(Lower, km, -one, ab.Off(km, j-km-1).CVector(), kld); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tZlacgv(km, ab.Off(km, j-km-1).CVector(), kld)\n\t\t}\n\n\t\t// Factorize the updated submatrix A(1:m,1:m) as U**H*U.\n\t\tfor j = 1; j <= m; j++ {\n\t\t\t// Compute s(j,j) and test for non-positive-definiteness.\n\t\t\tajj = ab.GetRe(0, j-1)\n\t\t\tif ajj <= zero {\n\t\t\t\tab.SetRe(0, j-1, ajj)\n\t\t\t\tgoto label50\n\t\t\t}\n\t\t\tajj = math.Sqrt(ajj)\n\t\t\tab.SetRe(0, j-1, ajj)\n\t\t\tkm = min(kd, m-j)\n\n\t\t\t// Compute elements j+1:j+km of the j-th column and update the\n\t\t\t// trailing submatrix within the band.\n\t\t\tif km > 0 {\n\t\t\t\tab.Off(1, j-1).CVector().Dscal(km, one/ajj, 1)\n\t\t\t\tif err = ab.Off(0, j).UpdateRows(kld).Her(Lower, km, -one, ab.Off(1, j-1).CVector(), 1); err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn\n\nlabel50:\n\t;\n\tinfo = j\n\n\treturn\n}",
"func VSUBSS_RN_SAE_Z(x, x1, k, x2 operand.Op) { ctx.VSUBSS_RN_SAE_Z(x, x1, k, x2) }",
"func TestPionE2ELossy(t *testing.T) {\n\t// Check for leaking routines\n\treport := transportTest.CheckRoutines(t)\n\tdefer report()\n\n\ttype runResult struct {\n\t\tdtlsConn *dtls.Conn\n\t\terr error\n\t}\n\n\tserverCert, err := selfsign.GenerateSelfSigned()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tclientCert, err := selfsign.GenerateSelfSigned()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfor _, test := range []struct {\n\t\tLossChanceRange int\n\t\tDoClientAuth bool\n\t\tCipherSuites []dtls.CipherSuiteID\n\t\tMTU int\n\t}{\n\t\t{\n\t\t\tLossChanceRange: 0,\n\t\t},\n\t\t{\n\t\t\tLossChanceRange: 10,\n\t\t},\n\t\t{\n\t\t\tLossChanceRange: 20,\n\t\t},\n\t\t{\n\t\t\tLossChanceRange: 50,\n\t\t},\n\t\t{\n\t\t\tLossChanceRange: 0,\n\t\t\tDoClientAuth: true,\n\t\t},\n\t\t{\n\t\t\tLossChanceRange: 10,\n\t\t\tDoClientAuth: true,\n\t\t},\n\t\t{\n\t\t\tLossChanceRange: 20,\n\t\t\tDoClientAuth: true,\n\t\t},\n\t\t{\n\t\t\tLossChanceRange: 50,\n\t\t\tDoClientAuth: true,\n\t\t},\n\t\t{\n\t\t\tLossChanceRange: 0,\n\t\t\tCipherSuites: []dtls.CipherSuiteID{dtls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA},\n\t\t},\n\t\t{\n\t\t\tLossChanceRange: 10,\n\t\t\tCipherSuites: []dtls.CipherSuiteID{dtls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA},\n\t\t},\n\t\t{\n\t\t\tLossChanceRange: 20,\n\t\t\tCipherSuites: []dtls.CipherSuiteID{dtls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA},\n\t\t},\n\t\t{\n\t\t\tLossChanceRange: 50,\n\t\t\tCipherSuites: []dtls.CipherSuiteID{dtls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA},\n\t\t},\n\t\t{\n\t\t\tLossChanceRange: 10,\n\t\t\tMTU: 100,\n\t\t\tDoClientAuth: true,\n\t\t},\n\t\t{\n\t\t\tLossChanceRange: 20,\n\t\t\tMTU: 100,\n\t\t\tDoClientAuth: true,\n\t\t},\n\t\t{\n\t\t\tLossChanceRange: 50,\n\t\t\tMTU: 100,\n\t\t\tDoClientAuth: true,\n\t\t},\n\t} {\n\t\tname := fmt.Sprintf(\"Loss%d_MTU%d\", test.LossChanceRange, test.MTU)\n\t\tif test.DoClientAuth {\n\t\t\tname += \"_WithCliAuth\"\n\t\t}\n\t\tfor _, ciph := range test.CipherSuites {\n\t\t\tname += \"_With\" + ciph.String()\n\t\t}\n\t\ttest := test\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\t// Limit runtime in case of deadlocks\n\t\t\tlim := transportTest.TimeOut(lossyTestTimeout + time.Second)\n\t\t\tdefer lim.Stop()\n\n\t\t\trand.Seed(time.Now().UTC().UnixNano())\n\t\t\tchosenLoss := rand.Intn(9) + test.LossChanceRange //nolint:gosec\n\t\t\tserverDone := make(chan runResult)\n\t\t\tclientDone := make(chan runResult)\n\t\t\tbr := transportTest.NewBridge()\n\n\t\t\tif err = br.SetLossChance(chosenLoss); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\n\t\t\tgo func() {\n\t\t\t\tcfg := &dtls.Config{\n\t\t\t\t\tFlightInterval: flightInterval,\n\t\t\t\t\tCipherSuites: test.CipherSuites,\n\t\t\t\t\tInsecureSkipVerify: true,\n\t\t\t\t\tMTU: test.MTU,\n\t\t\t\t}\n\n\t\t\t\tif test.DoClientAuth {\n\t\t\t\t\tcfg.Certificates = []tls.Certificate{clientCert}\n\t\t\t\t}\n\n\t\t\t\tclient, startupErr := dtls.Client(dtlsnet.PacketConnFromConn(br.GetConn0()), br.GetConn0().RemoteAddr(), cfg)\n\t\t\t\tclientDone <- runResult{client, startupErr}\n\t\t\t}()\n\n\t\t\tgo func() {\n\t\t\t\tcfg := &dtls.Config{\n\t\t\t\t\tCertificates: []tls.Certificate{serverCert},\n\t\t\t\t\tFlightInterval: flightInterval,\n\t\t\t\t\tMTU: test.MTU,\n\t\t\t\t}\n\n\t\t\t\tif test.DoClientAuth {\n\t\t\t\t\tcfg.ClientAuth = dtls.RequireAnyClientCert\n\t\t\t\t}\n\n\t\t\t\tserver, startupErr := dtls.Server(dtlsnet.PacketConnFromConn(br.GetConn1()), br.GetConn1().RemoteAddr(), cfg)\n\t\t\t\tserverDone <- runResult{server, startupErr}\n\t\t\t}()\n\n\t\t\ttestTimer := time.NewTimer(lossyTestTimeout)\n\t\t\tvar serverConn, clientConn *dtls.Conn\n\t\t\tdefer func() {\n\t\t\t\tif serverConn != nil {\n\t\t\t\t\tif err = serverConn.Close(); err != nil {\n\t\t\t\t\t\tt.Error(err)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif clientConn != nil {\n\t\t\t\t\tif err = clientConn.Close(); err != nil {\n\t\t\t\t\t\tt.Error(err)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\tfor {\n\t\t\t\tif serverConn != nil && clientConn != nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tbr.Tick()\n\t\t\t\tselect {\n\t\t\t\tcase serverResult := <-serverDone:\n\t\t\t\t\tif serverResult.err != nil {\n\t\t\t\t\t\tt.Errorf(\"Fail, serverError: clientComplete(%t) serverComplete(%t) LossChance(%d) error(%v)\", clientConn != nil, serverConn != nil, chosenLoss, serverResult.err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tserverConn = serverResult.dtlsConn\n\t\t\t\tcase clientResult := <-clientDone:\n\t\t\t\t\tif clientResult.err != nil {\n\t\t\t\t\t\tt.Errorf(\"Fail, clientError: clientComplete(%t) serverComplete(%t) LossChance(%d) error(%v)\", clientConn != nil, serverConn != nil, chosenLoss, clientResult.err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tclientConn = clientResult.dtlsConn\n\t\t\t\tcase <-testTimer.C:\n\t\t\t\t\tt.Errorf(\"Test expired: clientComplete(%t) serverComplete(%t) LossChance(%d)\", clientConn != nil, serverConn != nil, chosenLoss)\n\t\t\t\t\treturn\n\t\t\t\tcase <-time.After(10 * time.Millisecond):\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}",
"func (mutant *mutant) runVerticalSearch() {\n\n\tn := len(mutant.Adn)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n-SIZE_SUBSEQUENCE+1; {\n\t\t\tif mutant.counter >= MAX_SUBSEQUENCES {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tseq := mutant.getColumnFromRow(i, j)\n\t\t\tlastIndex := mutant.verifySequence(seq)\n\t\t\tj += 1 + lastIndex\n\t\t}\n\t}\n}",
"func Dlalsd(uplo mat.MatUplo, smlsiz, n, nrhs int, d, e *mat.Vector, b *mat.Matrix, rcond float64, work *mat.Vector, iwork *[]int) (rank, info int, err error) {\n\tvar cs, eps, one, orgnrm, r, rcnd, sn, tol, two, zero float64\n\tvar bx, bxst, c, difl, difr, givcol, givnum, givptr, i, icmpq1, icmpq2, iwk, j, k, nlvl, nm1, nsize, nsub, nwork, perm, poles, s, sizei, smlszp, sqre, st, st1, u, vt, z int\n\n\tzero = 0.0\n\tone = 1.0\n\ttwo = 2.0\n\n\t// Test the input parameters.\n\tif n < 0 {\n\t\terr = fmt.Errorf(\"n < 0: n=%v\", n)\n\t} else if nrhs < 1 {\n\t\terr = fmt.Errorf(\"nrhs < 1: nrhs=%v\", nrhs)\n\t} else if (b.Rows < 1) || (b.Rows < n) {\n\t\terr = fmt.Errorf(\"(b.Rows < 1) || (b.Rows < n): b.Rows=%v, n=%v\", b.Rows, n)\n\t}\n\tif err != nil {\n\t\tgltest.Xerbla2(\"Dlalsd\", err)\n\t\treturn\n\t}\n\n\teps = Dlamch(Epsilon)\n\n\t// Set up the tolerance.\n\tif (rcond <= zero) || (rcond >= one) {\n\t\trcnd = eps\n\t} else {\n\t\trcnd = rcond\n\t}\n\n\trank = 0\n\n\t// Quick return if possible.\n\tif n == 0 {\n\t\treturn\n\t} else if n == 1 {\n\t\tif d.Get(0) == zero {\n\t\t\tDlaset(Full, 1, nrhs, zero, zero, b)\n\t\t} else {\n\t\t\trank = 1\n\t\t\tif err = Dlascl('G', 0, 0, d.Get(0), one, 1, nrhs, b); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\td.Set(0, math.Abs(d.Get(0)))\n\t\t}\n\t\treturn\n\t}\n\n\t// Rotate the matrix if it is lower bidiagonal.\n\tif uplo == 'L' {\n\t\tfor i = 1; i <= n-1; i++ {\n\t\t\tcs, sn, r = Dlartg(d.Get(i-1), e.Get(i-1))\n\t\t\td.Set(i-1, r)\n\t\t\te.Set(i-1, sn*d.Get(i))\n\t\t\td.Set(i, cs*d.Get(i))\n\t\t\tif nrhs == 1 {\n\t\t\t\tb.Off(i, 0).Vector().Rot(1, b.Off(i-1, 0).Vector(), 1, 1, cs, sn)\n\t\t\t} else {\n\t\t\t\twork.Set(i*2-1-1, cs)\n\t\t\t\twork.Set(i*2-1, sn)\n\t\t\t}\n\t\t}\n\t\tif nrhs > 1 {\n\t\t\tfor i = 1; i <= nrhs; i++ {\n\t\t\t\tfor j = 1; j <= n-1; j++ {\n\t\t\t\t\tcs = work.Get(j*2 - 1 - 1)\n\t\t\t\t\tsn = work.Get(j*2 - 1)\n\t\t\t\t\tb.Off(j, i-1).Vector().Rot(1, b.Off(j-1, i-1).Vector(), 1, 1, cs, sn)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Scale.\n\tnm1 = n - 1\n\torgnrm = Dlanst('M', n, d, e)\n\tif orgnrm == zero {\n\t\tDlaset(Full, n, nrhs, zero, zero, b)\n\t\treturn\n\t}\n\n\tif err = Dlascl('G', 0, 0, orgnrm, one, n, 1, d.Matrix(n, opts)); err != nil {\n\t\tpanic(err)\n\t}\n\tif err = Dlascl('G', 0, 0, orgnrm, one, nm1, 1, e.Matrix(nm1, opts)); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// If N is smaller than the minimum divide size SMLSIZ, then solve\n\t// the problem with another solver.\n\tif n <= smlsiz {\n\t\tnwork = 1 + n*n\n\t\tDlaset(Full, n, n, zero, one, work.Matrix(n, opts))\n\t\tif info, err = Dlasdq(Upper, 0, n, n, 0, nrhs, d, e, work.Matrix(n, opts), work.Matrix(n, opts), b, work.Off(nwork-1)); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif info != 0 {\n\t\t\treturn\n\t\t}\n\t\ttol = rcnd * math.Abs(d.Get(d.Iamax(n, 1)-1))\n\t\tfor i = 1; i <= n; i++ {\n\t\t\tif d.Get(i-1) <= tol {\n\t\t\t\tDlaset(Full, 1, nrhs, zero, zero, b.Off(i-1, 0))\n\t\t\t} else {\n\t\t\t\tif err = Dlascl('G', 0, 0, d.Get(i-1), one, 1, nrhs, b.Off(i-1, 0)); err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\t\t\t\trank = rank + 1\n\t\t\t}\n\t\t}\n\t\tif err = work.Off(nwork-1).Matrix(n, opts).Gemm(Trans, NoTrans, n, nrhs, n, one, work.Matrix(n, opts), b, zero); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tDlacpy(Full, n, nrhs, work.Off(nwork-1).Matrix(n, opts), b)\n\n\t\t// Unscale.\n\t\tif err = Dlascl('G', 0, 0, one, orgnrm, n, 1, d.Matrix(n, opts)); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif err = Dlasrt('D', n, d); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif err = Dlascl('G', 0, 0, orgnrm, one, n, nrhs, b); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\treturn\n\t}\n\n\t// Book-keeping and setting up some constants.\n\tnlvl = int(math.Log(float64(n)/float64(smlsiz+1))/math.Log(two)) + 1\n\n\tsmlszp = smlsiz + 1\n\n\tu = 1\n\tvt = 1 + smlsiz*n\n\tdifl = vt + smlszp*n\n\tdifr = difl + nlvl*n\n\tz = difr + nlvl*n*2\n\tc = z + nlvl*n\n\ts = c + n\n\tpoles = s + n\n\tgivnum = poles + 2*nlvl*n\n\tbx = givnum + 2*nlvl*n\n\tnwork = bx + n*nrhs\n\n\tsizei = 1 + n\n\tk = sizei + n\n\tgivptr = k + n\n\tperm = givptr + n\n\tgivcol = perm + nlvl*n\n\tiwk = givcol + nlvl*n*2\n\n\tst = 1\n\tsqre = 0\n\ticmpq1 = 1\n\ticmpq2 = 0\n\tnsub = 0\n\n\tfor i = 1; i <= n; i++ {\n\t\tif math.Abs(d.Get(i-1)) < eps {\n\t\t\td.Set(i-1, math.Copysign(eps, d.Get(i-1)))\n\t\t}\n\t}\n\n\tfor i = 1; i <= nm1; i++ {\n\t\tif (math.Abs(e.Get(i-1)) < eps) || (i == nm1) {\n\t\t\tnsub = nsub + 1\n\t\t\t(*iwork)[nsub-1] = st\n\n\t\t\t// Subproblem found. First determine its size and then\n\t\t\t// apply divide and conquer on it.\n\t\t\tif i < nm1 {\n\t\t\t\t// A subproblem with E(I) small for I < NM1.\n\t\t\t\tnsize = i - st + 1\n\t\t\t\t(*iwork)[sizei+nsub-1-1] = nsize\n\t\t\t} else if math.Abs(e.Get(i-1)) >= eps {\n\t\t\t\t// A subproblem with E(NM1) not too small but I = NM1.\n\t\t\t\tnsize = n - st + 1\n\t\t\t\t(*iwork)[sizei+nsub-1-1] = nsize\n\t\t\t} else {\n\t\t\t\t// A subproblem with E(NM1) small. This implies an\n\t\t\t\t// 1-by-1 subproblem at D(N), which is not solved\n\t\t\t\t// explicitly.\n\t\t\t\tnsize = i - st + 1\n\t\t\t\t(*iwork)[sizei+nsub-1-1] = nsize\n\t\t\t\tnsub = nsub + 1\n\t\t\t\t(*iwork)[nsub-1] = n\n\t\t\t\t(*iwork)[sizei+nsub-1-1] = 1\n\t\t\t\twork.Off(bx+nm1-1).Copy(nrhs, b.Off(n-1, 0).Vector(), b.Rows, n)\n\t\t\t}\n\t\t\tst1 = st - 1\n\t\t\tif nsize == 1 {\n\t\t\t\t// This is a 1-by-1 subproblem and is not solved\n\t\t\t\t// explicitly.\n\t\t\t\twork.Off(bx+st1-1).Copy(nrhs, b.Off(st-1, 0).Vector(), b.Rows, n)\n\t\t\t} else if nsize <= smlsiz {\n\t\t\t\t// This is a small subproblem and is solved by DLASDQ.\n\t\t\t\tDlaset(Full, nsize, nsize, zero, one, work.Off(vt+st1-1).Matrix(n, opts))\n\t\t\t\tif info, err = Dlasdq(Upper, 0, nsize, nsize, 0, nrhs, d.Off(st-1), e.Off(st-1), work.Off(vt+st1-1).Matrix(n, opts), work.Off(nwork-1).Matrix(n, opts), b.Off(st-1, 0), work.Off(nwork-1)); err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\t\t\t\tif info != 0 {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tDlacpy(Full, nsize, nrhs, b.Off(st-1, 0), work.Off(bx+st1-1).Matrix(n, opts))\n\t\t\t} else {\n\t\t\t\t// A large problem. Solve it using divide and conquer.\n\t\t\t\tif info, err = Dlasda(icmpq1, smlsiz, nsize, sqre, d.Off(st-1), e.Off(st-1), work.Off(u+st1-1).Matrix(n, opts), work.Off(vt+st1-1).Matrix(n, opts), toSlice(iwork, k+st1-1), work.Off(difl+st1-1).Matrix(n, opts), work.Off(difr+st1-1).Matrix(n, opts), work.Off(z+st1-1).Matrix(n, opts), work.Off(poles+st1-1).Matrix(n, opts), toSlice(iwork, givptr+st1-1), toSlice(iwork, givcol+st1-1), n, toSlice(iwork, perm+st1-1), work.Off(givnum+st1-1).Matrix(n, opts), work.Off(c+st1-1), work.Off(s+st1-1), work.Off(nwork-1), toSlice(iwork, iwk-1)); err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\t\t\t\tif info != 0 {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tbxst = bx + st1\n\t\t\t\tif err = Dlalsa(icmpq2, smlsiz, nsize, nrhs, b.Off(st-1, 0), work.Off(bxst-1).Matrix(n, opts), work.Off(u+st1-1).Matrix(n, opts), work.Off(vt+st1-1).Matrix(n, opts), toSlice(iwork, k+st1-1), work.Off(difl+st1-1).Matrix(n, opts), work.Off(difr+st1-1).Matrix(n, opts), work.Off(z+st1-1).Matrix(n, opts), work.Off(poles+st1-1).Matrix(n, opts), toSlice(iwork, givptr+st1-1), toSlice(iwork, givcol+st1-1), n, toSlice(iwork, perm+st1-1), work.Off(givnum+st1-1).Matrix(n, opts), work.Off(c+st1-1), work.Off(s+st1-1), work.Off(nwork-1), toSlice(iwork, iwk-1)); err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tst = i + 1\n\t\t}\n\t}\n\n\t// Apply the singular values and treat the tiny ones as zero.\n\ttol = rcnd * math.Abs(d.Get(d.Iamax(n, 1)-1))\n\n\tfor i = 1; i <= n; i++ {\n\t\t// Some of the elements in D can be negative because 1-by-1\n\t\t// subproblems were not solved explicitly.\n\t\tif math.Abs(d.Get(i-1)) <= tol {\n\t\t\tDlaset(Full, 1, nrhs, zero, zero, work.Off(bx+i-1-1).Matrix(n, opts))\n\t\t} else {\n\t\t\trank = rank + 1\n\t\t\tif err = Dlascl('G', 0, 0, d.Get(i-1), one, 1, nrhs, work.Off(bx+i-1-1).Matrix(n, opts)); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t\td.Set(i-1, math.Abs(d.Get(i-1)))\n\t}\n\n\t// Now apply back the right singular vectors.\n\ticmpq2 = 1\n\tfor i = 1; i <= nsub; i++ {\n\t\tst = (*iwork)[i-1]\n\t\tst1 = st - 1\n\t\tnsize = (*iwork)[sizei+i-1-1]\n\t\tbxst = bx + st1\n\t\tif nsize == 1 {\n\t\t\tb.Off(st-1, 0).Vector().Copy(nrhs, work.Off(bxst-1), n, b.Rows)\n\t\t} else if nsize <= smlsiz {\n\t\t\tif err = b.Off(st-1, 0).Gemm(Trans, NoTrans, nsize, nrhs, nsize, one, work.Off(vt+st1-1).Matrix(n, opts), work.Off(bxst-1).Matrix(n, opts), zero); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t} else {\n\t\t\tif err = Dlalsa(icmpq2, smlsiz, nsize, nrhs, work.Off(bxst-1).Matrix(n, opts), b.Off(st-1, 0), work.Off(u+st1-1).Matrix(n, opts), work.Off(vt+st1-1).Matrix(n, opts), toSlice(iwork, k+st1-1), work.Off(difl+st1-1).Matrix(n, opts), work.Off(difr+st1-1).Matrix(n, opts), work.Off(z+st1-1).Matrix(n, opts), work.Off(poles+st1-1).Matrix(n, opts), toSlice(iwork, givptr+st1-1), toSlice(iwork, givcol+st1-1), n, toSlice(iwork, perm+st1-1), work.Off(givnum+st1-1).Matrix(n, opts), work.Off(c+st1-1), work.Off(s+st1-1), work.Off(nwork-1), toSlice(iwork, iwk-1)); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\t// Unscale and sort the singular values.\n\tif err = Dlascl('G', 0, 0, one, orgnrm, n, 1, d.Matrix(n, opts)); err != nil {\n\t\tpanic(err)\n\t}\n\tif err = Dlasrt('D', n, d); err != nil {\n\t\tpanic(err)\n\t}\n\tif err = Dlascl('G', 0, 0, orgnrm, one, n, nrhs, b); err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn\n}",
"func VCVTSD2SS_RN_SAE_Z(x, x1, k, x2 operand.Op) { ctx.VCVTSD2SS_RN_SAE_Z(x, x1, k, x2) }",
"func (fn *formulaFuncs) CHITEST(argsList *list.List) formulaArg {\n\tif argsList.Len() != 2 {\n\t\treturn newErrorFormulaArg(formulaErrorVALUE, \"CHITEST requires 2 arguments\")\n\t}\n\tactual, expected := argsList.Front().Value.(formulaArg), argsList.Back().Value.(formulaArg)\n\tactualList, expectedList := actual.ToList(), expected.ToList()\n\trows := len(actual.Matrix)\n\tcolumns := len(actualList) / rows\n\tif len(actualList) != len(expectedList) || len(actualList) == 1 {\n\t\treturn newErrorFormulaArg(formulaErrorNA, formulaErrorNA)\n\t}\n\tvar result float64\n\tvar degrees int\n\tfor i := 0; i < len(actualList); i++ {\n\t\ta, e := actualList[i].ToNumber(), expectedList[i].ToNumber()\n\t\tif a.Type == ArgNumber && e.Type == ArgNumber {\n\t\t\tif e.Number == 0 {\n\t\t\t\treturn newErrorFormulaArg(formulaErrorDIV, formulaErrorDIV)\n\t\t\t}\n\t\t\tif e.Number < 0 {\n\t\t\t\treturn newErrorFormulaArg(formulaErrorNUM, formulaErrorNUM)\n\t\t\t}\n\t\t\tresult += (a.Number - e.Number) * (a.Number - e.Number) / e.Number\n\t\t}\n\t}\n\tif rows == 1 {\n\t\tdegrees = columns - 1\n\t} else if columns == 1 {\n\t\tdegrees = rows - 1\n\t} else {\n\t\tdegrees = (columns - 1) * (rows - 1)\n\t}\n\targs := list.New()\n\targs.PushBack(newNumberFormulaArg(result))\n\targs.PushBack(newNumberFormulaArg(float64(degrees)))\n\treturn fn.CHIDIST(args)\n}",
"func VSQRTPD_RN_SAE_Z(z, k, z1 operand.Op) { ctx.VSQRTPD_RN_SAE_Z(z, k, z1) }",
"func VSUBSD_RN_SAE_Z(x, x1, k, x2 operand.Op) { ctx.VSUBSD_RN_SAE_Z(x, x1, k, x2) }",
"func Dlagv2(a, b *mat.Matrix, alphar, alphai, beta *mat.Vector) (csl, snl, csr, snr float64) {\n\tvar anorm, ascale, bnorm, bscale, h1, h2, h3, one, qq, rr, safmin, scale1, ulp, wi, wr1, zero float64\n\n\tzero = 0.0\n\tone = 1.0\n\n\tsafmin = Dlamch(SafeMinimum)\n\tulp = Dlamch(Precision)\n\n\t// Scale A\n\tanorm = math.Max(math.Abs(a.Get(0, 0))+math.Abs(a.Get(1, 0)), math.Max(math.Abs(a.Get(0, 1))+math.Abs(a.Get(1, 1)), safmin))\n\tascale = one / anorm\n\ta.Set(0, 0, ascale*a.Get(0, 0))\n\ta.Set(0, 1, ascale*a.Get(0, 1))\n\ta.Set(1, 0, ascale*a.Get(1, 0))\n\ta.Set(1, 1, ascale*a.Get(1, 1))\n\n\t// Scale B\n\tbnorm = math.Max(math.Abs(b.Get(0, 0)), math.Max(math.Abs(b.Get(0, 1))+math.Abs(b.Get(1, 1)), safmin))\n\tbscale = one / bnorm\n\tb.Set(0, 0, bscale*b.Get(0, 0))\n\tb.Set(0, 1, bscale*b.Get(0, 1))\n\tb.Set(1, 1, bscale*b.Get(1, 1))\n\n\t// Check if A can be deflated\n\tif math.Abs(a.Get(1, 0)) <= ulp {\n\t\tcsl = one\n\t\tsnl = zero\n\t\tcsr = one\n\t\tsnr = zero\n\t\ta.Set(1, 0, zero)\n\t\tb.Set(1, 0, zero)\n\t\twi = zero\n\n\t\t// Check if B is singular\n\t} else if math.Abs(b.Get(0, 0)) <= ulp {\n\t\tcsl, snl, _ = Dlartg(a.Get(0, 0), a.Get(1, 0))\n\t\tcsr = one\n\t\tsnr = zero\n\t\ta.Off(1, 0).Vector().Rot(2, a.Off(0, 0).Vector(), a.Rows, a.Rows, csl, snl)\n\t\tb.Off(1, 0).Vector().Rot(2, b.Off(0, 0).Vector(), b.Rows, b.Rows, csl, snl)\n\t\ta.Set(1, 0, zero)\n\t\tb.Set(0, 0, zero)\n\t\tb.Set(1, 0, zero)\n\t\twi = zero\n\n\t} else if math.Abs(b.Get(1, 1)) <= ulp {\n\t\tcsr, snr, _ = Dlartg(a.Get(1, 1), a.Get(1, 0))\n\t\tsnr = -snr\n\t\ta.Off(0, 1).Vector().Rot(2, a.Off(0, 0).Vector(), 1, 1, csr, snr)\n\t\tb.Off(0, 1).Vector().Rot(2, b.Off(0, 0).Vector(), 1, 1, csr, snr)\n\t\tcsl = one\n\t\tsnl = zero\n\t\ta.Set(1, 0, zero)\n\t\tb.Set(1, 0, zero)\n\t\tb.Set(1, 1, zero)\n\t\twi = zero\n\n\t} else {\n\t\t// B is nonsingular, first compute the eigenvalues of (A,B)\n\t\tscale1, _, wr1, _, wi = Dlag2(a, b, safmin)\n\n\t\tif wi == zero {\n\t\t\t// two real eigenvalues, compute s*A-w*B\n\t\t\th1 = scale1*a.Get(0, 0) - wr1*b.Get(0, 0)\n\t\t\th2 = scale1*a.Get(0, 1) - wr1*b.Get(0, 1)\n\t\t\th3 = scale1*a.Get(1, 1) - wr1*b.Get(1, 1)\n\n\t\t\trr = Dlapy2(h1, h2)\n\t\t\tqq = Dlapy2(scale1*a.Get(1, 0), h3)\n\n\t\t\tif rr > qq {\n\t\t\t\t// find right rotation matrix to zero 1,1 element of\n\t\t\t\t// (sA - wB)\n\t\t\t\tcsr, snr, _ = Dlartg(h2, h1)\n\n\t\t\t} else {\n\t\t\t\t// find right rotation matrix to zero 2,1 element of\n\t\t\t\t// (sA - wB)\n\t\t\t\tcsr, snr, _ = Dlartg(h3, scale1*a.Get(1, 0))\n\n\t\t\t}\n\n\t\t\tsnr = -snr\n\t\t\ta.Off(0, 1).Vector().Rot(2, a.Off(0, 0).Vector(), 1, 1, csr, snr)\n\t\t\tb.Off(0, 1).Vector().Rot(2, b.Off(0, 0).Vector(), 1, 1, csr, snr)\n\n\t\t\t// compute inf norms of A and B\n\t\t\th1 = math.Max(math.Abs(a.Get(0, 0))+math.Abs(a.Get(0, 1)), math.Abs(a.Get(1, 0))+math.Abs(a.Get(1, 1)))\n\t\t\th2 = math.Max(math.Abs(b.Get(0, 0))+math.Abs(b.Get(0, 1)), math.Abs(b.Get(1, 0))+math.Abs(b.Get(1, 1)))\n\n\t\t\tif (scale1 * h1) >= math.Abs(wr1)*h2 {\n\t\t\t\t// find left rotation matrix Q to zero out B(2,1)\n\t\t\t\tcsl, snl, _ = Dlartg(b.Get(0, 0), b.Get(1, 0))\n\n\t\t\t} else {\n\t\t\t\t// find left rotation matrix Q to zero out A(2,1)\n\t\t\t\tcsl, snl, _ = Dlartg(a.Get(0, 0), a.Get(1, 0))\n\n\t\t\t}\n\n\t\t\ta.Off(1, 0).Vector().Rot(2, a.Off(0, 0).Vector(), a.Rows, a.Rows, csl, snl)\n\t\t\tb.Off(1, 0).Vector().Rot(2, b.Off(0, 0).Vector(), b.Rows, b.Rows, csl, snl)\n\n\t\t\ta.Set(1, 0, zero)\n\t\t\tb.Set(1, 0, zero)\n\n\t\t} else {\n\t\t\t// a pair of complex conjugate eigenvalues\n\t\t\t// first compute the SVD of the matrix B\n\t\t\t_, _, snr, csr, snl, csl = Dlasv2(b.Get(0, 0), b.Get(0, 1), b.Get(1, 1))\n\n\t\t\t// Form (A,B) := Q(A,B)Z**T where Q is left rotation matrix and\n\t\t\t// Z is right rotation matrix computed from DLASV2\n\t\t\ta.Off(1, 0).Vector().Rot(2, a.Off(0, 0).Vector(), a.Rows, a.Rows, csl, snl)\n\t\t\tb.Off(1, 0).Vector().Rot(2, b.Off(0, 0).Vector(), b.Rows, b.Rows, csl, snl)\n\t\t\ta.Off(0, 1).Vector().Rot(2, a.Off(0, 0).Vector(), 1, 1, csr, snr)\n\t\t\tb.Off(0, 1).Vector().Rot(2, b.Off(0, 0).Vector(), 1, 1, csr, snr)\n\n\t\t\tb.Set(1, 0, zero)\n\t\t\tb.Set(0, 1, zero)\n\n\t\t}\n\n\t}\n\n\t// Unscaling\n\ta.Set(0, 0, anorm*a.Get(0, 0))\n\ta.Set(1, 0, anorm*a.Get(1, 0))\n\ta.Set(0, 1, anorm*a.Get(0, 1))\n\ta.Set(1, 1, anorm*a.Get(1, 1))\n\tb.Set(0, 0, bnorm*b.Get(0, 0))\n\tb.Set(1, 0, bnorm*b.Get(1, 0))\n\tb.Set(0, 1, bnorm*b.Get(0, 1))\n\tb.Set(1, 1, bnorm*b.Get(1, 1))\n\n\tif wi == zero {\n\t\talphar.Set(0, a.Get(0, 0))\n\t\talphar.Set(1, a.Get(1, 1))\n\t\talphai.Set(0, zero)\n\t\talphai.Set(1, zero)\n\t\tbeta.Set(0, b.Get(0, 0))\n\t\tbeta.Set(1, b.Get(1, 1))\n\t} else {\n\t\talphar.Set(0, anorm*wr1/scale1/bnorm)\n\t\talphai.Set(0, anorm*wi/scale1/bnorm)\n\t\talphar.Set(1, alphar.Get(0))\n\t\talphai.Set(1, -alphai.Get(0))\n\t\tbeta.Set(0, one)\n\t\tbeta.Set(1, one)\n\t}\n\n\treturn\n}",
"func VGETMANTSD_SAE(ops ...operand.Op) { ctx.VGETMANTSD_SAE(ops...) }"
] | [
"0.5577864",
"0.51757",
"0.49949348",
"0.491764",
"0.4837769",
"0.48017088",
"0.47225007",
"0.46483636",
"0.46271884",
"0.46165404",
"0.45453176",
"0.45346412",
"0.45028895",
"0.44566214",
"0.4451624",
"0.44084874",
"0.4402889",
"0.4395967",
"0.43845516",
"0.43688878",
"0.43522125",
"0.43246248",
"0.4322732",
"0.43170017",
"0.42988563",
"0.4275991",
"0.42527106",
"0.42517886",
"0.42128736",
"0.42121604",
"0.42037",
"0.4202558",
"0.41901478",
"0.41713062",
"0.416884",
"0.41367677",
"0.41352782",
"0.41252962",
"0.411637",
"0.41160154",
"0.4114137",
"0.40653878",
"0.40506923",
"0.40479022",
"0.4021016",
"0.40148336",
"0.40086707",
"0.40066466",
"0.40063372",
"0.40044188",
"0.4003481",
"0.40008932",
"0.39954174",
"0.3985425",
"0.39838105",
"0.39734808",
"0.39700353",
"0.39522535",
"0.3947496",
"0.39450365",
"0.3943774",
"0.39427906",
"0.39427856",
"0.39413905",
"0.39394447",
"0.39307696",
"0.39222533",
"0.39205962",
"0.39079764",
"0.3897344",
"0.3880166",
"0.38757384",
"0.38721728",
"0.38653702",
"0.38572118",
"0.3851795",
"0.3846091",
"0.38363242",
"0.38339767",
"0.38245472",
"0.38222116",
"0.38178962",
"0.38177472",
"0.3816504",
"0.37918717",
"0.37909827",
"0.37903318",
"0.3787566",
"0.378619",
"0.3783464",
"0.37793764",
"0.37733725",
"0.3769017",
"0.3759414",
"0.37582532",
"0.37528574",
"0.3744685",
"0.37430614",
"0.37369984",
"0.37316418"
] | 0.70653516 | 0 |
Seed uses the provided seed value to initialize the generator to a deterministic state. | func (pcg *PCGSource) Seed(seed uint64) {
pcg.low = seed
pcg.high = seed // TODO: What is right?
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (g *Generator) Seed(seed int64) {\n\tif _, err := g.hash.Write(int64ToBytes(seed)); err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err := g.reseed(); err != nil {\n\t\tpanic(err)\n\t}\n}",
"func (rng *Rng) Seed(seed int64) {\n\trng.State = uint64(seed)\n}",
"func (r *IncrementRand) Seed(seed int64) {\n\tr.seed = seed\n\tr.value = seed\n}",
"func Seed (seed int64) {\n\tlocalRand.Seed(seed)\n}",
"func Seed(seed int64) {\n\tr.Seed(seed)\n}",
"func Seed(seed int64) { globalRand.Seed(seed) }",
"func Seed(seed int64) {\n\tif seed == 0 {\n\t\trand.Seed(time.Now().UTC().UnixNano())\n\t} else {\n\t\trand.Seed(seed)\n\t}\n}",
"func (r *ConstantRand) Seed(seed int64) {\n\tr.seed = seed\n}",
"func (r *Rand) Seed(s int64) {\n\t*r = Rand(uint64(s))\n}",
"func (src *MT19937_64) Seed(seed uint64) {\n\tsrc.mt[0] = seed\n\tfor src.mti = 1; src.mti < mt19937_64NN; src.mti++ {\n\t\tsrc.mt[src.mti] = (6364136223846793005*(src.mt[src.mti-1]^(src.mt[src.mti-1]>>62)) + src.mti)\n\t}\n}",
"func (r *lockedRandSource) Seed(seed int64) {\n\tr.lock.Lock()\n\tr.src.Seed(seed)\n\tr.lock.Unlock()\n}",
"func (r *OrgBucketID) Seed(seed int64) {\n\tr.m.Lock()\n\tr.src = rand.New(rand.NewSource(seed))\n\tr.m.Unlock()\n}",
"func (gen *CMWC) Seed(seed int64) {\n\tgen.lock.Lock()\n\tdefer gen.lock.Unlock()\n\n\tgen.c = cmwcC\n\ts := uint32(seed)\n\tfor i := 0; i < 4096; i++ {\n\t\ts = s ^ s<<uint(i%63)\n\t\tgen.state[i] = s ^ uint32(seed)\n\t}\n}",
"func (rng *RandomNumberGenerator) SetSeed(seed int64) {\n\trng.seed = seed\n}",
"func (r *lockedSource) Seed(seed int64) {\n\tr.mut.Lock()\n\tr.src.Seed(seed)\n\tr.mut.Unlock()\n}",
"func (p *Pcg128) Seed(stateHigh, stateLow uint64) {\n\tp.lcg_128_seed(stateHigh, stateLow)\n}",
"func (rng *splitMix64Source) Seed(seed int64) {\n\trng.state = uint64(seed)\n}",
"func (genA *GeneticAlgorithm) SetSeed(seed int64) {\n\tgenA.RandomEngine = rand.New(rand.NewSource(seed))\n}",
"func (m *Model) SetSeed(seed int64) {}",
"func (s CrSource) Seed(int64) {}",
"func (r *ISAAC) Seed(seed int64) {\n\tr.randrsl = padSeed(uint64(seed))\n\tr.randInit()\n}",
"func (p *PCG64) Seed(low, high uint64) {\n\tp.low = low\n\tp.high = high\n}",
"func (f *Fortuna) Seed(seed int64) {\n\tif err := f.AddRandomEvent(0, 0, int64ToBytes(seed)); err != nil {\n\t\tpanic(err)\n\t}\n}",
"func (sp *SuperSpin) Seed(seed int64) {\n\tsp.seed = seed\n}",
"func (this *XXHash64) SetSeed(seed uint64) {\n\tthis.seed = seed\n}",
"func (s *ClarifyShapConfig) SetSeed(v int64) *ClarifyShapConfig {\n\ts.Seed = &v\n\treturn s\n}",
"func (baseModel *BaseModel) SetSeed(seed int64) {\n baseModel.Rng = rand.New(rand.NewSource(seed)).Float64\n baseModel.RngSet = true\n}",
"func (g *fixedNameGenerator) SetSeed(seed int64) {\n\tg.r.Seed(seed)\n}",
"func (R *RAND) Seed(rawlen int, raw []byte) { /* initialise from at least 128 byte string of raw random entropy */\n\tvar b [4]byte\n\tsh := NewHASH256()\n\tR.pool_ptr = 0\n\n\tfor i := 0; i < rand_NK; i++ {\n\t\tR.ira[i] = 0\n\t}\n\tif rawlen > 0 {\n\t\tfor i := 0; i < rawlen; i++ {\n\t\t\tsh.Process(raw[i])\n\t\t}\n\t\tdigest := sh.Hash()\n\n\t\t/* initialise PRNG from distilled randomness */\n\n\t\tfor i := 0; i < 8; i++ {\n\t\t\tb[0] = digest[4*i]\n\t\t\tb[1] = digest[4*i+1]\n\t\t\tb[2] = digest[4*i+2]\n\t\t\tb[3] = digest[4*i+3]\n\t\t\tR.sirand(pack(b))\n\t\t}\n\t}\n\tR.fill_pool()\n}",
"func GenerateSeed(rand io.Reader) (string, error) {\n\tif rand == nil {\n\t\trand = cryptorand.Reader\n\t}\n\tbytes := make([]byte, 32)\n\tif _, err := rand.Read(bytes); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn hex.EncodeToString(bytes), nil\n}",
"func (h *Hash) Seed() Seed {\n\th.initSeed()\n\treturn h.seed\n}",
"func RandomUniformSeed(value int64) RandomUniformAttr {\n\treturn func(m optionalAttr) {\n\t\tm[\"seed\"] = value\n\t}\n}",
"func (k *EdX25519Key) Seed() *[ed25519.SeedSize]byte {\n\tpk := ed25519.PrivateKey(k.privateKey[:])\n\treturn Bytes32(pk.Seed())\n}",
"func SetSeed() error {\n\t// 为math\n\tseedByte, err := walletRand.GenerateSeedWithStrengthAndKeyLen(walletRand.KeyStrengthHard, walletRand.KeyLengthInt64)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbytesBuffer := bytes.NewBuffer(seedByte)\n\tvar seed int64\n\tbinary.Read(bytesBuffer, binary.BigEndian, &seed)\n\trand.Seed(seed)\n\n\treturn nil\n}",
"func (m *MT) Seed(theseed int64) {\n\t// Lower 32bit\n\tseed := uint32(theseed)\n\tfor m.lp = 0; m.lp < 624; m.lp++ {\n\t\tm.Key[m.lp] = seed\n\t\tseed = (uint32(1812433253)*(seed^(seed>>30)) + m.lp + 1) & 0xffffffff\n\t\t//m.arrayL[m.lp] = 0x6c078965*(m.arrayL[m.lp-1]^(m.arrayL[m.lp-1]>>30)) + m.lp\n\t}\n}",
"func (kp *FromAddress) Seed() (string, error) {\n\treturn \"\", ErrNoSeed\n}",
"func (m *Mnemonic) GenerateSeed(passphrase string) *Seed {\n\treturn NewSeed(m.Sentence(), passphrase)\n}",
"func (s *ShuffleConfig) SetSeed(v int64) *ShuffleConfig {\n\ts.Seed = &v\n\treturn s\n}",
"func (mt *MT19937) seed(val uint32) {\n\tmt.index = n\n\tmt.state[0] = val\n\tfor i := 1; i < (n - 1); i++ {\n\t\tmt.state[i] = f*(mt.state[i-1]^(mt.state[i-1]>>(w-2))) + uint32(i)\n\t}\n}",
"func Seed(n int) {\n\tdatastore.Seed(n)\n}",
"func (board *Board) Seed() {\n\tr := rand.New(rand.NewSource(time.Now().UnixNano()))\n\n\ttimes := 0\n\n\tfor times == 0 {\n\t\ttimes = r.Intn(board.Rows * board.Columns)\n\t}\n\n\tfor t := 0; t < times; t++ {\n\t\ti, j := rand.Intn(board.Rows), rand.Intn(board.Columns)\n\n\t\tboard.Cells[i][j].SetAlive(true)\n\t}\n}",
"func seedDice(seed uint64) {\n\trng := pcg.NewPCG64()\n\trng.Seed(rng.Random(), rng.Random(), rng.Random(), rng.Random())\n\trng.Seed(seed, DiceSeq, seed*seed, DiceSeq+1)\n\tdice.SetDefaultRandomness(rng)\n}",
"func (w *Wallet) InitSeed(s *aklib.DBConfig, pwd []byte) error {\n\tseed := make([]byte, 32)\n\tif _, err := rand.Read(seed); err != nil {\n\t\tpanic(err)\n\t}\n\tw.EncSeed = address.EncryptSeed(seed, pwd)\n\treturn w.put(s)\n}",
"func SetRngSeed(seed int64) {\n\trng.Seed(seed)\n}",
"func (r *Randomizer) UseSeed() int64 {\n\t// Store our old seed\n\tvar oldSeed int64 = r.seed\n\n\t// Generate new one\n\tr.seed = time.Now().Unix()\n\n\t// Send it off!\n\treturn oldSeed\n}",
"func RandSeed() (uint32, error) {\n\tb := make([]byte, 4)\n\tif _, err := rand.Read(b); err != nil {\n\t\treturn 0, err\n\t}\n\treturn binary.LittleEndian.Uint32(b), nil\n}",
"func (w *World) WithSeed(seed int64) *World {\n\tw.rand = rand.New(rand.NewSource(seed))\n\n\treturn w\n}",
"func (b *Handler) Seed() []byte {\n\tb.lock.RLock()\n\tdefer b.lock.RUnlock()\n\n\tcpy := make([]byte, len(b.seed))\n\tcopy(cpy, b.seed)\n\n\treturn cpy\n}",
"func (u Universe) Seed() {\n\t//random numbers - using math/rand lib rand.Intn()\n\t//25% of cells in Universe\n\tpercentageOfCells := int(float64(len(u)*len(u[0])) * 0.25)\n\tfor i := 0; i <= percentageOfCells; i++ {\n\t\tu[rand.Intn(15)][rand.Intn(80)] = true\n\t}\n\t//\n}",
"func (g *TransactionResultGenerator) WithSeed(seed int64) *TransactionResultGenerator {\n\tg.rng = rand.New(rand.NewSource(seed))\n\treturn g\n}",
"func (h *Hash) SetSeed(seed Seed) {\n\tif seed.s == 0 {\n\t\tpanic(\"maphash: use of uninitialized Seed\")\n\t}\n\th.seed = seed\n\th.state = seed\n\th.n = 0\n}",
"func (sg *SeedGenerator) Next() (*Seed, error) {\n\tseed := Seed{}\n\t_, err := rand.Read(seed[:])\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"[ SeedGenerator::Next ]\")\n\t}\n\n\treturn &seed, nil\n}",
"func (x *SplitMix64) Seed(seed int64) {\n\t*x = SplitMix64(seed)\n}",
"func RandomUniformIntSeed(value int64) RandomUniformIntAttr {\n\treturn func(m optionalAttr) {\n\t\tm[\"seed\"] = value\n\t}\n}",
"func NewSeed() Seed {\n\treturn SeedFromEntropy(frand.Entropy128())\n}",
"func Init(seed int) {\n\tif seed <= 0 {\n\t\tseed = int(time.Now().Unix())\n\t}\n\trand.Seed(int64(seed))\n}",
"func TestSeed(t *testing.T) {\n\tzeroBytes := make([]byte, 32)\n\tsecurityDomain := []byte(\"test\")\n\tr := NewPRNG(securityDomain)\n\tr.Reseed(zeroBytes)\n}",
"func (u Universe) Seed() {\n\tfor i := 0; i < (width * height / 4); i++ {\n\t\tu.Set(rand.Intn(width), rand.Intn(height), true)\n\t}\n}",
"func New(seed int64) *Faker {\n\t// If passing 0 create crypto safe int64 for initial seed number\n\tif seed == 0 {\n\t\tbinary.Read(crand.Reader, binary.BigEndian, &seed)\n\t}\n\n\treturn &Faker{Rand: rand.New(&lockedSource{src: rand.NewSource(seed).(rand.Source64)})}\n}",
"func RandomPoissonSeed(value int64) RandomPoissonAttr {\n\treturn func(m optionalAttr) {\n\t\tm[\"seed\"] = value\n\t}\n}",
"func RandomGammaSeed(value int64) RandomGammaAttr {\n\treturn func(m optionalAttr) {\n\t\tm[\"seed\"] = value\n\t}\n}",
"func seedRandom() error {\n\t/* Get an int64 from the CSPRNG */\n\tb := make([]byte, 8)\n\t_, err := crand.Read(b)\n\tif nil != err {\n\t\treturn err\n\t}\n\ti := binary.LittleEndian.Uint64(b)\n\n\t/* Use it to seed the PRNG */\n\tmrand.Seed(int64(i))\n\n\treturn nil\n}",
"func (g *Game) SeedRand() {\n\n\t//Find the center (approximate for odd height or width) Cell of the board\n\txMid := g.cols / 2\n\tyMid := g.rows / 2\n\n\t//TEMP placeholder for actual random number generator\n\trand := []int{0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1}\n\n\t//Iterate over a 4x4 square around the center Cell\n\ti := 0\n\tfor y := yMid - 1; y < yMid+3; y++ {\n\t\tfor x := xMid - 1; x < xMid+3; x++ {\n\t\t\tif rand[i] == 1 {\n\t\t\t\tg.state[y][x].Alive = !g.state[y][x].Alive\n\t\t\t}\n\t\t\ti++\n\t\t}\n\t}\n\n\t//Update the copy\n\tfor y := 0; y < int(g.rows); y++ {\n\t\tfor x := 0; x < int(g.cols); x++ {\n\t\t\tg.board[y][x] = g.state[y+1][x+1]\n\t\t}\n\t}\n\n\treturn\n}",
"func New(seed int64) *rand.Rand {\n\treturn rand.New(NewSource(seed))\n}",
"func NewGenerator(seed uint64, delay int) Generator {\n\tprng := rand.New(mt19937.New())\n\tprng.Seed(int64(seed))\n\treturn &generator{\n\t\tseed: seed,\n\t\tdelay: delay,\n\t\tprng: prng,\n\t}\n}",
"func NewSeed(optionalSeedBytes ...[]byte) *Seed {\n\treturn &Seed{\n\t\ted25519.NewSeed(optionalSeedBytes...),\n\t}\n}",
"func NewRandFromSeed(seed []byte) *rand.Rand {\n\thash := sha256.Sum256(seed)\n\treturn rand.New(rand.NewSource(int64(binary.BigEndian.Uint64(hash[8:]))))\n}",
"func New(seed int64) Rand {\n\treturn Rand{\n\t\tRand: rand.New(NewLockedSource64(rand.NewSource(seed))),\n\t}\n}",
"func randSeed() uint32 {\n\treturn uint32(time.Now().UnixNano() + int64(os.Getpid()))\n}",
"func Seed(db *sql.DB) error {\n\ttx, err := db.Begin()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, err := tx.Exec(seeds); err != nil {\n\t\tif err := tx.Rollback(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn err\n\t}\n\n\treturn tx.Commit()\n}",
"func randWithSeed(max int) (rnd int) {\n\ttime.Sleep(1)\n\trand.Seed(time.Now().UnixNano())\n\trnd = rand.Intn(max)\n\treturn\n}",
"func NewSeed(seed int64) SkipList {\n\treturn NewSeedEps(seed, eps)\n}",
"func (rng *Tunafish) Seed() ([]byte, error) {\n\tif !rng.Initialised() {\n\t\treturn nil, ErrNotInitialised\n\t}\n\n\tvar p = make([]byte, SeedFileLength)\n\t_, err := io.ReadFull(rng, p)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn p, nil\n}",
"func (wallet *Wallet) Seed() *seed.Seed {\n\treturn wallet.addressManager.seed\n}",
"func NewRandomGenerator(seed int64) RandomGenerator {\n\treturn RandomGenerator{rand.New(rand.NewSource(int64(seed)))}\n}",
"func RandomShuffleSeed(value int64) RandomShuffleAttr {\n\treturn func(m optionalAttr) {\n\t\tm[\"seed\"] = value\n\t}\n}",
"func (g *Gateway) GenerateSeed(w http.ResponseWriter, r *http.Request) {\n\tseed, e := g.generateSeed()\n\tif e != nil {\n\t\tsend(w, e.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tsend(w, seed, http.StatusOK)\n}",
"func getSeed() {\n\tpid := os.Getpid()\n\tvar pid64 int64\n\tpid64 = int64(pid)\n\ttimeNow := time.Now().UTC().UnixNano()\n\tseedInt := pid64 + timeNow\n\trand.Seed(seedInt)\n}",
"func SeedPRNG() {\n\tb := make([]byte, 8)\n\t_, err := crand.Read(b)\n\tif nil != err {\n\t\tpanic(fmt.Sprintf(\"Rand: %v\", err))\n\t}\n\trand.Seed(int64(binary.LittleEndian.Uint64(b)))\n}",
"func (g *Generator) SeedBytes(seed []byte) {\n\tif _, err := g.hash.Write(seed); err != nil {\n\t\tpanic(err)\n\t}\n\n\tif err := g.reseed(); err != nil {\n\t\tpanic(err)\n\t}\n}",
"func MakeSeed() Seed {\n\tvar s1, s2 uint64\n\tfor {\n\t\ts1 = uint64(runtime_fastrand())\n\t\ts2 = uint64(runtime_fastrand())\n\t\t// We use seed 0 to indicate an uninitialized seed/hash,\n\t\t// so keep trying until we get a non-zero seed.\n\t\tif s1|s2 != 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn Seed{s: s1<<32 + s2}\n}",
"func RandomCropSeed(value int64) RandomCropAttr {\n\treturn func(m optionalAttr) {\n\t\tm[\"seed\"] = value\n\t}\n}",
"func (h *Hash) initSeed() {\n\tif h.seed.s == 0 {\n\t\tseed := MakeSeed()\n\t\th.seed = seed\n\t\th.state = seed\n\t}\n}",
"func (obj *identity) Seed() string {\n\treturn obj.seed\n}",
"func (o *ListDCForSeedParams) SetSeed(seedName string) {\n\to.Seed = seedName\n}",
"func RandomPoissonV2Seed(value int64) RandomPoissonV2Attr {\n\treturn func(m optionalAttr) {\n\t\tm[\"seed\"] = value\n\t}\n}",
"func New(seedName string) (seed model.Seed) {\n\tswitch seedName {\n\tcase \"acorn\":\n\t\tseed = Acorn\n\tcase \"blinker\":\n\t\tseed = Blinker\n\tcase \"diehard\":\n\t\tseed = DieHard\n\tcase \"glider\":\n\t\tseed = Glider\n\tcase \"rpentomino\":\n\t\tseed = RPentomino\n\tdefault:\n\t\tpanic(\"unknown seed\")\n\t}\n\treturn\n}",
"func Seed(ctx context.Context, db *sqlx.DB) error {\n\tif err := database.StatusCheck(ctx, db); err != nil {\n\t\treturn errors.Wrap(err, \"status check database\")\n\t}\n\n\ttx, err := db.Begin()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, err := tx.Exec(seedDoc); err != nil {\n\t\tif err := tx.Rollback(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn err\n\t}\n\n\treturn tx.Commit()\n}",
"func (r *Randomizer) GetSeed() int64 {\n\treturn r.seed\n}",
"func (wc *WalletCreate) SetSeed(s string) *WalletCreate {\n\twc.mutation.SetSeed(s)\n\treturn wc\n}",
"func NewGenerator(seed int64) *Generator {\n\tg := &Generator{\n\t\tseed: seed,\n\t\tnoise: opensimplex.New(seed),\n\t}\n\n\treturn g\n}",
"func Randomisieren () {\n\trand.Seed(time.Now().UnixNano())\n}",
"func (t TestRepo) Seed() {\n\tt.SaveFile(\"README\", \"\", \"foo\\n\")\n\ttreeOid := t.Stage(\"README\")\n\tt.Commit(treeOid)\n}",
"func (c *Cuckoo) SetEvictionSeed(seed int64) {\n\tc.eseed = seed\n\trand.Seed(seed)\n}",
"func UniformCandidateSamplerSeed(value int64) UniformCandidateSamplerAttr {\n\treturn func(m optionalAttr) {\n\t\tm[\"seed\"] = value\n\t}\n}",
"func NewRand(seed int64) *rand.Rand {\n\treturn rand.New(&lockedSource{src: rand.NewSource(seed).(rand.Source64)})\n}",
"func (rng *splitMix64Source) Seed64(seed uint64) {\n\trng.state = seed\n}",
"func (s *HyperParameterTuningJobConfig) SetRandomSeed(v int64) *HyperParameterTuningJobConfig {\n\ts.RandomSeed = &v\n\treturn s\n}",
"func init() {\n\t// As rand.Seed() expect an int64 as input,\n\t// convert the time to unix nano before passing it to the function.\n\trand.Seed(time.Now().UnixNano())\n}",
"func seedRandomizer() {\n var b [8]byte\n _, err := crypto_rand.Read(b[:])\n if err != nil {\n panic(\"cannot seed math/rand package with cryptographically secure random number generator\")\n }\n math_rand.Seed(int64(binary.LittleEndian.Uint64(b[:])))\n}"
] | [
"0.81474304",
"0.80678666",
"0.80196023",
"0.79634714",
"0.7962229",
"0.7902593",
"0.789541",
"0.7818182",
"0.778867",
"0.7637324",
"0.7571526",
"0.7546818",
"0.7346723",
"0.7326138",
"0.719774",
"0.7144702",
"0.71144444",
"0.7054397",
"0.7032221",
"0.6991642",
"0.6984232",
"0.68821144",
"0.682713",
"0.6794827",
"0.67384183",
"0.67308456",
"0.6688471",
"0.66783404",
"0.66394615",
"0.66158724",
"0.65486705",
"0.65313053",
"0.6519739",
"0.65016264",
"0.6494856",
"0.63918936",
"0.63914627",
"0.6328587",
"0.63244313",
"0.6314939",
"0.62769204",
"0.62518775",
"0.6246176",
"0.6238661",
"0.62201566",
"0.62180215",
"0.61684847",
"0.616597",
"0.61646706",
"0.61582506",
"0.61402565",
"0.6132127",
"0.61188155",
"0.608997",
"0.6082268",
"0.6050091",
"0.60469675",
"0.60338366",
"0.600282",
"0.5999366",
"0.5992263",
"0.5975704",
"0.5965231",
"0.5963292",
"0.59500545",
"0.59466535",
"0.59414685",
"0.59158754",
"0.59140384",
"0.59126604",
"0.58530605",
"0.58520234",
"0.5850556",
"0.58442086",
"0.5823616",
"0.5801493",
"0.57732975",
"0.5756725",
"0.5694408",
"0.56879896",
"0.56598276",
"0.56531537",
"0.5643617",
"0.5616095",
"0.5577794",
"0.5571427",
"0.5568206",
"0.5557694",
"0.5556064",
"0.55457836",
"0.5543664",
"0.5521289",
"0.5519514",
"0.55194217",
"0.5517663",
"0.55155605",
"0.5510259",
"0.5472212",
"0.5465942",
"0.5451838"
] | 0.72496384 | 14 |
Uint64 returns a pseudorandom 64bit unsigned integer as a uint64. | func (pcg *PCGSource) Uint64() uint64 {
pcg.multiply()
pcg.add()
// XOR high and low 64 bits together and rotate right by high 6 bits of state.
return bits.RotateLeft64(pcg.high^pcg.low, -int(pcg.high>>58))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func Uint64() uint64 { return globalRand.Uint64() }",
"func Uint64() uint64 { return globalRand.Uint64() }",
"func Uint64() uint64 { return globalRand.Uint64() }",
"func Uint64() uint64 {\n\treturn uint64(rand.Int63n(math.MaxInt64))\n}",
"func (r *Rand) Uint64() uint64 {\n\t*r ^= Rand(uint64(*r) >> 12)\n\t*r ^= Rand(uint64(*r) << 25)\n\t*r ^= Rand(uint64(*r) >> 27)\n\treturn uint64(*r) * 2685821657736338717\n}",
"func RandomUint64() (randInt uint64) {\n\trandomBytes := make([]byte, 8)\n\trand.Read(randomBytes)\n\treturn siaencoding.DecUint64(randomBytes)\n}",
"func (r *Rand) Uint64() uint64 {\n\tif x, err := r.cryptoRand.Uint64(); err == nil {\n\t\treturn x\n\t}\n\treturn r.mathRand.Uint64()\n}",
"func RandomUint64() uint64 {\n\treturn rand.Uint64()\n}",
"func randomUint64(t *testing.T) uint64 {\n\tbigInt, err := rand.Int(rand.Reader, new(big.Int).SetUint64(math.MaxUint64))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn bigInt.Uint64()\n}",
"func RandomUint64() (uint64, error) {\n\trandByte := make([]byte, 8)\n\tif _, err := rand.Read(randByte); err != nil {\n\t\treturn 0, err\n\t}\n\treturn binary.LittleEndian.Uint64(randByte), nil\n}",
"func RandUint64() uint64 {\n\tbint64 := make([]byte, 8)\n\tif _, err := rand.Read(bint64); err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn binary.LittleEndian.Uint64(bint64)\n}",
"func randUint64(r *rand.Rand) uint64 {\n\treturn uint64(r.Uint32())<<32 | uint64(r.Uint32())\n}",
"func (rng *Rng) Uint64() uint64 {\n\trng.State += 0x9E3779B97F4A7C15\n\tz := rng.State\n\tz = (z ^ (z >> 30)) * 0xBF58476D1CE4E5B9\n\tz = (z ^ (z >> 27)) * 0x94D049BB133111EB\n\treturn z ^ (z >> 31)\n}",
"func RandUint64() uint64 {\n\tb := RandBytes(8)\n\treturn binary.BigEndian.Uint64(b)\n}",
"func RandomUint64() uint64 {\n\tbuf := make([]byte, 8)\n\t_, err := rand.Read(buf)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn binary.LittleEndian.Uint64(buf)\n}",
"func RandUint64() uint64 {\n\ti := uint64(rand.Int63())\n\treturn i\n}",
"func NewRandUint64() (uint64, error) {\n\tvar b [8]byte\n\t_, err := rand.Read(b[:])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn binary.LittleEndian.Uint64(b[:]), nil\n}",
"func randUint64(rand cipher.Stream) uint64 {\n\tb := random.Bits(64, false, rand)\n\treturn binary.BigEndian.Uint64(b)\n}",
"func (p *PCG64) Uint64() uint64 {\n\tp.multiply()\n\tp.add()\n\t// XOR high and low 64 bits together and rotate right by high 6 bits of state.\n\treturn bits.RotateLeft64(p.high^p.low, -int(p.high>>58))\n}",
"func (p *siprng) Uint64() uint64 {\n\tp.mu.Lock()\n\tif p.ctr == 0 || p.ctr > 8*1024*1024 {\n\t\tp.rekey()\n\t}\n\tv := siphash(p.k0, p.k1, p.ctr)\n\tp.ctr++\n\tp.mu.Unlock()\n\treturn v\n}",
"func NewUInt64() *UInt64 {\n\tself := UInt64{}\n\tself.SetDefaults()\n\treturn &self\n}",
"func randUInt64() uint64 {\n\tbits := rand.Uint32() % 64\n\tif bits == 0 {\n\t\treturn 0\n\t}\n\tn := uint64(1 << (bits - 1))\n\tn += uint64(rand.Int63()) & ((1 << (bits - 1)) - 1)\n\treturn n\n}",
"func (bh *bh_rng) Uint64() (v uint64) {\n\tbinary.Read(bh, binary.BigEndian, &v)\n\treturn\n}",
"func (rng *splitMix64Source) Uint64() uint64 {\n\trng.state += 0x9E3779B97F4A7C15\n\tz := rng.state\n\tz = (z ^ (z >> 30)) * 0xBF58476D1CE4E5B9\n\tz = (z ^ (z >> 27)) * 0x94D049BB133111EB\n\treturn z ^ (z >> 31)\n}",
"func (r *ISAAC) Uint64() (number uint64) {\n\tr.Lock.Lock()\n\tdefer r.Lock.Unlock()\n\tnumber = r.randrsl[r.randcnt]\n\tr.randcnt++\n\tif r.randcnt == 256 {\n\t\tr.generateNextSet()\n\t\tr.randcnt = 0\n\t}\n\treturn\n}",
"func NewUint64(store *store.Store, cfgPath string) *Uint64 {\n\tf := &Uint64{}\n\tf.init(store, f.mapCfgValue, cfgPath)\n\treturn f\n}",
"func (u Uint64) Uint64() uint64 {\n\treturn uint64(u)\n}",
"func Uint64(name string, value uint64, usage string) *uint64 {\n\treturn Environment.Uint64(name, value, usage)\n}",
"func (id *Id) Uint64() uint64 {\n\treturn uint64(*id)\n}",
"func (i *UInt64) UInt64() uint64 {\n\treturn uint64(*i)\n}",
"func Uint64(flag string, value uint64, description string) *uint64 {\n\tvar v uint64\n\tUint64Var(&v, flag, value, description)\n\treturn &v\n}",
"func (sm64 *splitMix64) Uint64() uint64 {\n\tsm64.state = sm64.state + uint64(0x9E3779B97F4A7C15)\n\tz := sm64.state\n\tz = (z ^ (z >> 30)) * uint64(0xBF58476D1CE4E5B9)\n\tz = (z ^ (z >> 27)) * uint64(0x94D049BB133111EB)\n\treturn z ^ (z >> 31)\n\n}",
"func Uint64(name string, value uint64, usage string) *uint64 {\n\tp := new(uint64);\n\tUint64Var(p, name, value, usage);\n\treturn p;\n}",
"func (n BlockNonce) Uint64() uint64 {\n\treturn binary.BigEndian.Uint64(n[:])\n}",
"func (n BlockNonce) Uint64() uint64 {\n\treturn binary.BigEndian.Uint64(n[:])\n}",
"func (s *OptionalUInt64) UInt64() uint64 {\n\treturn s.Value\n}",
"func RandomUint64(n uint64) (x uint64) {\n\trnd := rndGen.GetRand()\n\tif n == 0 {\n\t\tx = rnd.Uint64()\n\t} else {\n\t\tx = rnd.Uint64() % n\n\t}\n\trndGen.PutRand(rnd)\n\treturn\n}",
"func GetUint64(key string) uint64 { return viper.GetUint64(key) }",
"func Uint64(name string, alias rune, value uint64, usage string, fn Callback) *uint64 {\n\treturn CommandLine.Uint64(name, alias, value, usage, fn)\n}",
"func (c Continue) RandUint64() uint64 {\n\treturn randUint64(c.Rand)\n}",
"func NewUint64(value uint64) *Uint64 {\n\treturn &Uint64{\n\t\tvalue: value,\n\t}\n}",
"func Uint64(u *uint64) uint64 {\n\tif u == nil {\n\t\treturn 0\n\t}\n\treturn *u\n}",
"func NewUint64(data arrow.ArrayData, shape, strides []int64, names []string) *Uint64 {\n\ttsr := &Uint64{tensorBase: *newTensor(arrow.PrimitiveTypes.Uint64, data, shape, strides, names)}\n\tvals := tsr.data.Buffers()[1]\n\tif vals != nil {\n\t\ttsr.values = arrow.Uint64Traits.CastFromBytes(vals.Bytes())\n\t\tbeg := tsr.data.Offset()\n\t\tend := beg + tsr.data.Len()\n\t\ttsr.values = tsr.values[beg:end]\n\t}\n\treturn tsr\n}",
"func Uint64(uint64 uint64) *uint64 {\n\treturn &uint64\n}",
"func (f *FlagSet) Uint64(name string, alias rune, value uint64, usage string, fn Callback) *uint64 {\n\tp := new(uint64)\n\tf.Uint64Var(p, name, alias, value, usage, fn)\n\treturn p\n}",
"func Uint64(name string, value uint64, usage string) *uint64 {\n\treturn ex.FlagSet.Uint64(name, value, usage)\n}",
"func (ob *PyObject) Uint64() uint64 {\n\treturn uint64(C.PyLong_AsUnsignedLongLong(ob.rawptr))\n}",
"func (x *Secp256k1N) Uint64() uint64 {\n\treturn x.limbs[0] + (x.limbs[1]&0xfff)<<52\n}",
"func UInt64(v uint64) *uint64 {\n\treturn &v\n}",
"func Uint() uint { return globalRand.Uint() }",
"func NewTagUint64(ls *lua.LState) int {\n\tvar val = uint64(ls.CheckInt(1))\n\tPushTag(ls, &LuaTag{wpk.TagUint64(val)})\n\treturn 1\n}",
"func Uint64(key string, val uint64) Tag {\n\treturn Tag{key: key, tType: uint64Type, integerVal: int64(val)}\n}",
"func (i *Int64) UInt64() uint64 {\n\treturn uint64(*i)\n}",
"func (src *MT19937_64) Uint64() uint64 {\n\tmag01 := [2]uint64{0, mt19937_64MatrixA}\n\n\tvar x uint64\n\tif src.mti >= mt19937_64NN { // Generate mt19937_64NN words at one time.\n\t\tif src.mti == mt19937_64NN+1 {\n\t\t\t// If Seed() has not been called\n\t\t\t// a default initial seed is used.\n\t\t\tsrc.Seed(5489)\n\t\t}\n\n\t\tvar i int\n\t\tfor ; i < mt19937_64NN-mt19937_64MM; i++ {\n\t\t\tx = (src.mt[i] & mt19937_64UpperMask) | (src.mt[i+1] & mt19937_64LowerMask)\n\t\t\tsrc.mt[i] = src.mt[i+mt19937_64MM] ^ (x >> 1) ^ mag01[(int)(x&0x1)]\n\t\t}\n\t\tfor ; i < mt19937_64NN-1; i++ {\n\t\t\tx = (src.mt[i] & mt19937_64UpperMask) | (src.mt[i+1] & mt19937_64LowerMask)\n\t\t\tsrc.mt[i] = src.mt[i+(mt19937_64MM-mt19937_64NN)] ^ (x >> 1) ^ mag01[(int)(x&0x1)]\n\t\t}\n\t\tx = (src.mt[mt19937_64NN-1] & mt19937_64UpperMask) | (src.mt[0] & mt19937_64LowerMask)\n\t\tsrc.mt[mt19937_64NN-1] = src.mt[mt19937_64MM-1] ^ (x >> 1) ^ mag01[(int)(x&0x1)]\n\n\t\tsrc.mti = 0\n\t}\n\n\tx = src.mt[src.mti]\n\tsrc.mti++\n\n\t// Tempering.\n\tx ^= (x >> 29) & 0x5555555555555555\n\tx ^= (x << 17) & 0x71D67FFFEDA60000\n\tx ^= (x << 37) & 0xFFF7EEE000000000\n\tx ^= (x >> 43)\n\n\treturn x\n}",
"func NewUint64(inp uint64) B64 {\n\tvar resp = []B64{\n\t\tnewUint64(inp),\n\t}\n\treturn resp[0]\n}",
"func (this UIDGenerator) GenerateUint() (uint64, error) {\n\tnow, err := this.getTimeMicroseconds()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tcurrentID := this.getNextUintID()\n\tcurrentTS := now << defaultTimestampBitsRightPadding\n\n\treturn currentTS | this.nodeID | currentID, nil\n}",
"func (no *Node) UInt64() (uint64, error) {\n\tvar out uint64\n\tif err := binary.Read(no.buf, binary.LittleEndian, &out); err != nil {\n\t\treturn 0, err\n\t}\n\treturn out, nil\n}",
"func GetUint64(key string, def uint64) uint64 {\n\ts, ok := os.LookupEnv(key)\n\tif !ok {\n\t\treturn def\n\t}\n\n\tv, err := strconv.ParseUint(s, decimalBase, bitSize64)\n\tif err != nil {\n\t\treturn def\n\t}\n\n\treturn v\n}",
"func UInt64(r interface{}, err error) (uint64, error) {\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tswitch r := r.(type) {\n\tcase uint64:\n\t\treturn r, err\n\tcase int:\n\t\tif r < 0 {\n\t\t\treturn 0, simplesessions.ErrAssertType\n\t\t}\n\t\treturn uint64(r), nil\n\tcase int64:\n\t\tif r < 0 {\n\t\t\treturn 0, simplesessions.ErrAssertType\n\t\t}\n\t\treturn uint64(r), nil\n\tcase []byte:\n\t\tn, err := strconv.ParseUint(string(r), 10, 64)\n\t\treturn n, err\n\tcase string:\n\t\tn, err := strconv.ParseUint(r, 10, 64)\n\t\treturn n, err\n\tcase nil:\n\t\treturn 0, simplesessions.ErrNil\n\t}\n\n\treturn 0, simplesessions.ErrAssertType\n}",
"func (x *Int) Uint64() uint64 {}",
"func UInt64Get(p []byte) uint64 {\n\treturn binary.LittleEndian.Uint64(p)\n}",
"func Uint64(x *big.Int) uint64 {\n\treturn x.Uint64()\n}",
"func NewUint64(x uint64) *Numeric {\n\tvar r Numeric\n\treturn r.SetUint64(x)\n}",
"func Uint64(v uint64) *uint64 {\n\treturn &v\n}",
"func Uint64(v uint64) *uint64 {\n\treturn &v\n}",
"func Uint64(input []byte, startBitPos int) (result uint64, resultPtr *uint64, err error) {\n\tif Len(input)-startBitPos < 64 {\n\t\treturn 0, nil, errors.New(\"Input is less than 64 bits\")\n\t}\n\n\ttmpArr, _, err := SubBits(input, startBitPos, 64)\n\tresult = binary.BigEndian.Uint64(tmpArr)\n\n\treturn result, &result, err\n}",
"func (d *Decoder) Uint64() uint64 {\n\tdata := d.tmp[:8]\n\tn, err := d.buf.Read(data)\n\tif n < 8 || err != nil {\n\t\tpanic(\"unmarshalUint64\")\n\t}\n\treturn binary.LittleEndian.Uint64(data)\n}",
"func (r *Decoder) Uint64() uint64 {\n\tr.Sync(SyncUint64)\n\treturn r.rawUvarint()\n}",
"func Uint64(v *uint64) uint64 {\n\tif v != nil {\n\t\treturn *v\n\t}\n\treturn 0\n}",
"func Uint64(v interface{}) (uint64, error) {\n\tvar err error\n\tv = indirect(v)\n\n\tswitch n := v.(type) {\n\tcase int8:\n\t\tif n < 0 {\n\t\t\terr = OverflowError{ToType: \"uint64\", Value: v}\n\t\t}\n\t\treturn uint64(n), err\n\tcase int16:\n\t\tif n < 0 {\n\t\t\terr = OverflowError{ToType: \"uint64\", Value: v}\n\t\t}\n\t\treturn uint64(n), err\n\tcase int32:\n\t\tif n < 0 {\n\t\t\terr = OverflowError{ToType: \"uint64\", Value: v}\n\t\t}\n\t\treturn uint64(n), err\n\tcase int64:\n\t\tif n < 0 {\n\t\t\terr = OverflowError{ToType: \"uint64\", Value: v}\n\t\t}\n\t\treturn uint64(n), err\n\tcase int:\n\t\tif n < 0 {\n\t\t\terr = OverflowError{ToType: \"uint64\", Value: v}\n\t\t}\n\t\treturn uint64(n), err\n\tcase uint8:\n\t\treturn uint64(n), err\n\tcase uint16:\n\t\treturn uint64(n), err\n\tcase uint32:\n\t\treturn uint64(n), err\n\tcase uint64:\n\t\treturn n, err\n\tcase uint:\n\t\treturn uint64(n), err\n\t}\n\n\treturn 0, InvalidTypeError{ToType: \"uint64\", Value: v}\n}",
"func Uint64(name string, defaultValue uint64) uint64 {\n\tif strVal, ok := os.LookupEnv(name); ok {\n\t\tif i64, err := strconv.ParseUint(strVal, 10, 64); err == nil {\n\t\t\treturn i64\n\t\t}\n\t}\n\n\treturn defaultValue\n}",
"func NewUint64(vals ...uint64) Uint64 {\n\tsize := max(len(vals), minSize)\n\tset := Uint64{\n\t\tm: make(map[uint64]struct{}, size),\n\t}\n\tset.Add(vals...)\n\treturn set\n}",
"func GetUint64(key string) uint64 {\n\treturn v.GetUint64(key)\n}",
"func opUI64Rand(prgrm *CXProgram) {\n\texpr := prgrm.GetExpr()\n\tfp := prgrm.GetFramePointer()\n\n\toutV0 := rand.Uint64()\n\tWriteUI64(GetFinalOffset(fp, expr.Outputs[0]), outV0)\n}",
"func (n *Uint256) Uint64() uint64 {\n\treturn n.n[0]\n}",
"func Uint64Arg(register Register, name string, options ...ArgOptionApplyer) *uint64 {\n\tp := new(uint64)\n\t_ = Uint64ArgVar(register, p, name, options...)\n\treturn p\n}",
"func (s *EnvVarSet) Uint64(name string, value uint64, usage string) *uint64 {\n\tp := new(uint64)\n\n\ts.Uint64Var(p, name, value, usage)\n\n\treturn p\n}",
"func GetUint64(key string) uint64 {\n\treturn toUint64(Parse(key))\n}",
"func GetUint64(section, option string) uint64 {\n\treturn cfg.GetUint64(section, option)\n}",
"func GetUint64(key string) uint64 {\n\treturn cargoboat.GetUint64(key)\n}",
"func (recv *Value) GetUint64() uint64 {\n\tretC := C.g_value_get_uint64((*C.GValue)(recv.native))\n\tretGo := (uint64)(retC)\n\n\treturn retGo\n}",
"func (ic *Counter) Uint64() uint64 {\n\treturn atomic.AddUint64((*uint64)(ic), 0)\n}",
"func (k *Key) Uint64() (uint64, error) {\n\treturn strconv.ParseUint(k.String(), 10, 64)\n}",
"func FormatUint64(format string, v ...any) uint64 {\n\treturn GetUint64(Format(format, v...))\n}",
"func Uint64P(short rune, long string, value uint64, description string) *uint64 {\n\tvar v uint64\n\tUint64VarP(&v, short, long, value, description)\n\treturn &v\n}",
"func NewUint64Setting(name string, description string, fallback uint64) *Uint64Setting {\n\treturn &Uint64Setting{\n\t\tBaseSetting: &BaseSetting{\n\t\t\tNameValue: name,\n\t\t\tDescriptionValue: description,\n\t\t},\n\t\tUint64Value: &fallback,\n\t}\n}",
"func (r *Rand) Uint() uint {\n\tif x, err := r.cryptoRand.Uint(); err == nil {\n\t\treturn x\n\t}\n\treturn r.mathRand.Uint()\n}",
"func Uint64(val interface{}) uint64 {\r\n\r\n\tswitch t := val.(type) {\r\n\tcase int:\r\n\t\treturn uint64(t)\r\n\tcase int8:\r\n\t\treturn uint64(t)\r\n\tcase int16:\r\n\t\treturn uint64(t)\r\n\tcase int32:\r\n\t\treturn uint64(t)\r\n\tcase int64:\r\n\t\treturn uint64(t)\r\n\tcase uint:\r\n\t\treturn uint64(t)\r\n\tcase uint8:\r\n\t\treturn uint64(t)\r\n\tcase uint16:\r\n\t\treturn uint64(t)\r\n\tcase uint32:\r\n\t\treturn uint64(t)\r\n\tcase uint64:\r\n\t\treturn uint64(t)\r\n\tcase float32:\r\n\t\treturn uint64(t)\r\n\tcase float64:\r\n\t\treturn uint64(t)\r\n\tcase bool:\r\n\t\tif t == true {\r\n\t\t\treturn uint64(1)\r\n\t\t}\r\n\t\treturn uint64(0)\r\n\tdefault:\r\n\t\ts := String(val)\r\n\t\ti, _ := strconv.ParseUint(s, 10, 64)\r\n\t\treturn i\r\n\t}\r\n\r\n\tpanic(\"Reached\")\r\n\r\n}",
"func (a *Address) uint64() uint64 {\n\tv := binary.BigEndian.Uint64(a[:])\n\treturn v\n}",
"func (sto *RocksdbStorage) GetUint64(key string) (uint64, error) {\n\tbytes, err := sto.Get(key)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tval, err := BytesToUint64(bytes)\n\treturn val, err\n}",
"func (w *Writer) Uint64(n uint64) {\n\tw.buf = strconv.AppendUint(w.buf, uint64(n), 10)\n}",
"func (s Service) Uint64() uint64 {\n\treturn uint64(s)\n}",
"func (obj *Value) GetUint64() uint64 {\n\treturn obj.Candy().Guify(\"g_value_get_uint64\", obj).MustUint64()\n}",
"func u64(wr *wrappers.UInt64Value) *uint64 {\n\tif wr == nil {\n\t\treturn nil\n\t}\n\tresult := new(uint64)\n\t*result = wr.GetValue()\n\n\treturn result\n}",
"func (s STags) GetUint64(tag string, fields ...string) (value uint64) {\n\tn, ok := s.getNum(vUINT64, tag, fields...)\n\tif ok {\n\t\tvalue = n.(uint64)\n\t}\n\treturn\n}",
"func Uint64(num uint64) *cells.BinaryCell {\n\treturn cells.New(OpUint64, proto.EncodeVarint(num))\n}",
"func (c *Config) GetUint64(pattern string, def ...interface{}) uint64 {\n\tif j := c.getJson(); j != nil {\n\t\treturn j.GetUint64(pattern, def...)\n\t}\n\treturn 0\n}",
"func Uint64(i uint64) string {\n\t// Base 10\n\treturn strconv.FormatUint(i, 10)\n}",
"func GenRand64Int64() uint64 {\n\treturn uint64(C.genrand64_int64())\n}",
"func (r *Reader) ReadUInt64() uint64 {\n\tidx := r.currentReadIndex\n\tr.currentReadIndex += 8\n\treturn uint64(r.bufBytes[idx]) | uint64(r.bufBytes[idx+1])<<8 | uint64(r.bufBytes[idx+2])<<16 | uint64(r.bufBytes[idx+3])<<24 |\n\t\tuint64(r.bufBytes[idx+4])<<32 | uint64(r.bufBytes[idx+5])<<40 | uint64(r.bufBytes[idx+6])<<48 | uint64(r.bufBytes[idx+7])<<56\n}"
] | [
"0.85524464",
"0.85524464",
"0.85524464",
"0.8548207",
"0.82831895",
"0.8275276",
"0.8270503",
"0.81276894",
"0.8116648",
"0.8092832",
"0.8072181",
"0.803838",
"0.8019394",
"0.8018397",
"0.80127335",
"0.7956805",
"0.7886797",
"0.78492033",
"0.7765266",
"0.77565616",
"0.77368253",
"0.7714744",
"0.7690856",
"0.764278",
"0.7537147",
"0.7510344",
"0.75005245",
"0.7434468",
"0.74051726",
"0.73854315",
"0.7345497",
"0.7336882",
"0.73311275",
"0.7313192",
"0.7313192",
"0.7250131",
"0.7218153",
"0.72084886",
"0.71854204",
"0.7175355",
"0.7173824",
"0.7148891",
"0.7146522",
"0.71110886",
"0.7106236",
"0.7063896",
"0.70578843",
"0.7056775",
"0.70553327",
"0.7050361",
"0.7048789",
"0.70215946",
"0.7007629",
"0.70033944",
"0.69957787",
"0.699112",
"0.6965904",
"0.6959446",
"0.69549",
"0.69479823",
"0.69354665",
"0.6927904",
"0.6910906",
"0.69080657",
"0.69080657",
"0.69051987",
"0.690439",
"0.69032836",
"0.6902212",
"0.6898486",
"0.68917406",
"0.68872374",
"0.6880279",
"0.68727416",
"0.6872252",
"0.6860015",
"0.6857763",
"0.68540204",
"0.6852288",
"0.683901",
"0.6824478",
"0.68123424",
"0.6806296",
"0.6800118",
"0.6796572",
"0.6790733",
"0.6770287",
"0.67648745",
"0.67579955",
"0.6756377",
"0.67554206",
"0.6730744",
"0.6709216",
"0.6706499",
"0.67039114",
"0.6690867",
"0.6685986",
"0.6684012",
"0.6681471",
"0.6671045"
] | 0.7374187 | 30 |
MarshalBinary returns the binary representation of the current state of the generator. | func (pcg *PCGSource) MarshalBinary() ([]byte, error) {
var buf [16]byte
binary.BigEndian.PutUint64(buf[:8], pcg.high)
binary.BigEndian.PutUint64(buf[8:], pcg.low)
return buf[:], nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (s *State) Marshall() []byte {\n\to := make([]byte, 136)\n\tbinary.BigEndian.PutUint64(o, s.counter)\n\tcopy(o[8:], s.static[:])\n\tcopy(o[40:], s.dynamic[:])\n\tcopy(o[72:], s.privateKey[:])\n\tcopy(o[104:], s.PublicKey[:])\n\treturn o\n}",
"func (tx *Genesis) MarshalBinary(scheme Scheme) ([]byte, error) {\n\tb, err := tx.BodyMarshalBinary(scheme)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to marshal Genesis transaction to bytes\")\n\t}\n\treturn b, nil\n}",
"func (this *simWorld) MarshalBinary() (data []byte, err error) {\n\t// var addrs = map[uintptr]uint64{}\n\tbuf := bytes.NewBuffer(make([]byte, 0, 791874))\n\tif err = this.marshalTo(buf /*, addrs*/); err == nil {\n\t\tdata = buf.Bytes()\n\t}\n\treturn\n}",
"func (state RequestContextBatchState) Marshal() ([]byte, error) {\n\treturn []byte{byte(state)}, nil\n}",
"func (v Palette) MarshalBinary() (data []byte, err error) {\n\tdata = make([]byte, 3*len(v))\n\tfor i := 0; i < len(v); i++ {\n\t\tdata[i*3] = v[i].r\n\t\tdata[i*3+1] = v[i].g\n\t\tdata[i*3+2] = v[i].b\n\t}\n\treturn data, nil\n}",
"func (r *RatchetState) Marshall() []byte {\n\to := make([]byte, 136)\n\tbinary.BigEndian.PutUint64(o, r.counter)\n\tcopy(o[8:], r.static[:])\n\tcopy(o[40:], r.dynamic[:])\n\tcopy(o[72:], r.privateKey[:])\n\tcopy(o[104:], r.PublicKey[:])\n\treturn o\n}",
"func (state RequestContextState) Marshal() ([]byte, error) {\n\treturn []byte{byte(state)}, nil\n}",
"func (p *Pending) MarshalBinary() ([]byte, error) {\n\tbuf := new(bytes.Buffer)\n\n\tvar err error\n\tif _, err = buf.Write(p.Address); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif _, err = buf.Write(p.Amount.Bytes(binary.BigEndian)); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn buf.Bytes(), nil\n}",
"func (v PHYVersion) MarshalBinary() ([]byte, error) {\n\treturn marshalBinaryEnum(int32(v)), nil\n}",
"func (app *TokenAccountState) MarshalBinary() (ret []byte, err error) {\n\tvar coinbase []byte\n\tif app.Coinbase != nil {\n\t\tcoinbase, err = app.Coinbase.MarshalBinary()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tdata := make([]byte, tokenAccountStateLen+len(coinbase))\n\n\ti := copy(data[:], app.IssuerIdentity[:])\n\ti += copy(data[i:], app.IssuerChainId[:])\n\n\tapp.Balance.FillBytes(data[i:])\n\ti += 32\n\n\tif app.Coinbase != nil {\n\t\tcopy(data[i:], coinbase)\n\t}\n\n\treturn data, nil\n}",
"func (g *Generic) MarshalBinary() ([]byte, error) {\n\tb := make([]byte, g.MarshalLen())\n\tif err := g.MarshalTo(b); err != nil {\n\t\treturn nil, err\n\t}\n\treturn b, nil\n}",
"func (this *pool) MarshalBinary() ([]byte, error) {\n\t// Create wrapper from pool struct and serialize\n\twrapper := &poolData{this.users}\n\treturn serialize(wrapper)\n}",
"func (d *DynamoDB) MarshalBinary() ([]byte, error) {\n\tcontent, err := d.parser.Parse(dynamoDbAddonPath, *d, template.WithFuncs(storageTemplateFunctions))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn content.Bytes(), nil\n}",
"func (b *Block) MarshalBinary() ([]byte, error) {\n\treturn json.Marshal(b)\n}",
"func (sk *PrivateKey) MarshalBinary() ([]byte, error) {\n\treturn sk.Bytes(), nil\n}",
"func (p privateKey) MarshalBinary() (data []byte, err error) {\n\treturn p.PrivateKey.Bytes(), nil\n}",
"func (src *MT19937_64) MarshalBinary() ([]byte, error) {\n\tvar buf [(mt19937_64NN + 1) * 8]byte\n\tfor i := 0; i < mt19937_64NN; i++ {\n\t\tbinary.BigEndian.PutUint64(buf[i*8:(i+1)*8], src.mt[i])\n\t}\n\tbinary.BigEndian.PutUint64(buf[mt19937_64NN*8:], src.mti)\n\treturn buf[:], nil\n}",
"func Marshal(v interface{}) ([]byte, error) {\n\te := &encodeState{}\n\terr := e.marshal(v)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn e.Bytes(), nil\n}",
"func (s *Specification) MarshalBinary() ([]byte, error) {\n\treturn json.Marshal(s)\n}",
"func (t DataEncryptionBackendType) MarshalBinary() (data []byte, err error) {\n\tb := make([]byte, 4)\n\tbinary.LittleEndian.PutUint32(b, uint32(t))\n\treturn b[:DataEncryptionTypeSize], nil\n}",
"func (dt Depth) MarshalBinary() []byte {\n\tdata := make([]byte, DepthSize)\n\tbinary.LittleEndian.PutUint16(data, uint16(dt))\n\treturn data\n}",
"func (e *Event) MarshalBinary() ([]byte, error) {\n\treturn e.MarshalJSON()\n}",
"func (g *Game) Marshal() []byte {\n\treturn []byte(`{\"id\":\"` + g.id + `\",\"board\":\"` + string(g.board) + `\",\"status\":\"` + g.status + `\"}`)\n}",
"func (pk *PublicKey) MarshalBinary() ([]byte, error) {\n\treturn pk.Bytes(), nil\n}",
"func (i Transform) MarshalBinary() (data []byte, err error) {\n\treturn []byte(i.String()), nil\n}",
"func (k KeyEncryptionBackendType) MarshalBinary() (data []byte, err error) {\n\tb := make([]byte, 4)\n\tbinary.LittleEndian.PutUint32(b, uint32(k))\n\treturn b[:KeyEncryptionKeyTypeSize], nil\n}",
"func (obj *ServerMemoryInfoImpl) MarshalBinary() ([]byte, error) {\n\t// A simple encoding: plain text.\n\tvar b bytes.Buffer\n\t_, err := fmt.Fprintln(&b, obj.processMemory, obj.sharedMemory)\n\tif err != nil {\n\t\tlogger.Error(fmt.Sprintf(\"ERROR: Returning ServerMemoryInfoImpl:MarshalBinary w/ Error: '%+v'\", err.Error()))\n\t\treturn nil, err\n\t}\n\treturn b.Bytes(), nil\n}",
"func (p *Parameters) MarshalBinary() ([]byte, error) {\n\tif p.N == 0 { // if N is 0, then p is the zero value\n\t\treturn []byte{}, nil\n\t}\n\tb := utils.NewBuffer(make([]byte, 0, 3+((2+len(p.Qi)+len(p.Pi))<<3)))\n\tb.WriteUint8(uint8(bits.Len64(p.N) - 1))\n\tb.WriteUint8(uint8(len(p.Qi)))\n\tb.WriteUint8(uint8(len(p.Pi)))\n\tb.WriteUint64(p.T)\n\tb.WriteUint64(uint64(p.Sigma * (1 << 32)))\n\tb.WriteUint64Slice(p.Qi)\n\tb.WriteUint64Slice(p.Pi)\n\treturn b.Bytes(), nil\n}",
"func (s Side) MarshalBinary() (data []byte, err error) {\n\tif s {\n\t\tdata = []byte{0x01}\n\t\treturn\n\t}\n\tdata = []byte{0x00}\n\treturn\n}",
"func (id ID) MarshalBinary() ([]byte, error) {\n\tenc := marshal.NewEncoder(nil)\n\tid.Marshal(enc)\n\treturn marshal.ReleaseEncoder(enc), nil\n}",
"func (cfg frozenConfig) Marshal(val interface{}) ([]byte, error) {\n return encoder.Encode(val, cfg.encoderOpts)\n}",
"func (p *Property) MarshalBinary() ([]byte, error) {\n\tbuf := new(bytes.Buffer)\n\n\t// #nosec: Errors unhandled\n\t_ = binary.Write(buf, binary.LittleEndian, &p.header)\n\n\tswitch p.header.Kind {\n\tcase vixPropertyTypeBool:\n\t\t// #nosec: Errors unhandled\n\t\t_ = binary.Write(buf, binary.LittleEndian, p.data.Bool)\n\tcase vixPropertyTypeInt32:\n\t\t// #nosec: Errors unhandled\n\t\t_ = binary.Write(buf, binary.LittleEndian, p.data.Int32)\n\tcase vixPropertyTypeInt64:\n\t\t// #nosec: Errors unhandled\n\t\t_ = binary.Write(buf, binary.LittleEndian, p.data.Int64)\n\tcase vixPropertyTypeString:\n\t\t// #nosec: Errors unhandled\n\t\t_, _ = buf.WriteString(p.data.String)\n\t\t// #nosec: Errors unhandled\n\t\t_ = buf.WriteByte(0)\n\tcase vixPropertyTypeBlob:\n\t\t// #nosec: Errors unhandled\n\t\t_, _ = buf.Write(p.data.Blob)\n\t}\n\n\treturn buf.Bytes(), nil\n}",
"func (r Raw) MarshalBinary() (binary []byte, err error) {\r\n\tvar buf bytes.Buffer\r\n\tif _, err = r.WriteTo(&buf); err != nil {\r\n\t\treturn\r\n\t}\r\n\r\n\treturn buf.Bytes(), nil\r\n}",
"func (bp *BasePayload) MarshalBinary() ([]byte, error) {\n\treturn json.Marshal(bp)\n}",
"func (o *Organism) MarshalBinary() ([]byte, error) {\n\tvar buf bytes.Buffer\n\t_, err := fmt.Fprintln(&buf, o.Fitness, o.Generation, o.highestFitness, o.isPopulationChampionChild, o.Genotype.Id)\n\to.Genotype.Write(&buf)\n\tif err != nil {\n\t\treturn nil, err\n\t} else {\n\t\treturn buf.Bytes(), nil\n\t}\n}",
"func Binary() []byte {\n\treturn binary\n}",
"func (v MACCommandIdentifier) MarshalBinary() ([]byte, error) {\n\treturn marshalBinaryEnum(int32(v)), nil\n}",
"func (p *Parameters) MarshalBinary() (data []byte, err error) {\n\tdata = []byte{}\n\ttmp := []byte{}\n\n\tif tmp, err = p.SlotsToCoeffsParameters.MarshalBinary(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tdata = append(data, uint8(len(tmp)))\n\tdata = append(data, tmp...)\n\n\tif tmp, err = p.EvalModParameters.MarshalBinary(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tdata = append(data, uint8(len(tmp)))\n\tdata = append(data, tmp...)\n\n\tif tmp, err = p.CoeffsToSlotsParameters.MarshalBinary(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tdata = append(data, uint8(len(tmp)))\n\tdata = append(data, tmp...)\n\n\ttmp = make([]byte, 4)\n\ttmp[0] = uint8(p.H >> 24)\n\ttmp[1] = uint8(p.H >> 16)\n\ttmp[2] = uint8(p.H >> 8)\n\ttmp[3] = uint8(p.H >> 0)\n\tdata = append(data, tmp...)\n\treturn\n}",
"func (p publicKey) MarshalBinary() (data []byte, err error) {\n\treturn p.PublicKey.Bytes(), nil\n}",
"func (d Decimal) MarshalBinary() (data []byte, err error) {\n\t// Write the exponent first since it's a fixed size\n\tv1 := make([]byte, 4)\n\tbinary.BigEndian.PutUint32(v1, uint32(d.exp))\n\n\t// Add the value\n\tvar v2 []byte\n\tif v2, err = d.value.GobEncode(); err != nil {\n\t\treturn\n\t}\n\n\t// Return the byte array\n\tdata = append(v1, v2...)\n\treturn\n}",
"func (c *Config) Binary() []byte {\n\t// TODO: ensure this is sorted?\n\tout, _ := json.MarshalIndent(&Binary{\n\t\tName: c.BinaryName,\n\t\tRepo: c.BuildRepo,\n\t\tBuild: c.BuildCommand,\n\t\tVersion: c.BuildVersion,\n\t}, \"\", \" \")\n\treturn out\n}",
"func (priv *PrivateKey) Marshal() []byte {\n\tout := make([]byte, 0, 3*32)\n\tout = appendN(out, priv.xi1)\n\tout = appendN(out, priv.xi2)\n\tout = appendN(out, priv.gamma)\n\treturn out\n}",
"func (io *FactoidTransactionIO) MarshalBinary() ([]byte, error) {\n\tamount := varintf.Encode(io.Amount)\n\tdata := make([]byte, 32+len(amount))\n\tvar i int\n\ti += copy(data[i:], amount)\n\ti += copy(data[i:], io.Address[:])\n\treturn data, nil\n}",
"func (g Name) MarshalBinary() (data []byte, err error) {\n\tif len(g) == 0 {\n\t\treturn []byte(\" \"), nil\n\t}\n\n\tres := []byte(g)\n\n\tif len(res) != grammemeNameLength {\n\t\treturn []byte{}, fmt.Errorf(\"%w: %T.MarshalBinary(%v)=%v len=%d\", common.ErrMarshal, g, g, res, len(res))\n\t}\n\n\treturn res, nil\n}",
"func (b *BitStream) MarshalBinary() ([]byte, error) {\n\tbuf := new(bytes.Buffer)\n\terr := binary.Write(buf, binary.BigEndian, b.count)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = binary.Write(buf, binary.BigEndian, b.stream)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf.Bytes(), nil\n}",
"func (this *hobby) MarshalBinary() (data []byte, err error) {\n\t// var addrs = map[uintptr]uint64{}\n\tbuf := bytes.NewBuffer(make([]byte, 0, ((((((((8 + len(this.Name)) + 8) + 16) + 1) + 4) + 16) + 1) + 16)))\n\tif err = this.marshalTo(buf /*, addrs*/); err == nil {\n\t\tdata = buf.Bytes()\n\t}\n\treturn\n}",
"func (prefix DevAddrPrefix) MarshalBinary() ([]byte, error) {\n\treturn prefix.Bytes(), nil\n}",
"func (this *person) MarshalBinary() (data []byte, err error) {\n\t// var addrs = map[uintptr]uint64{}\n\tbuf := bytes.NewBuffer(make([]byte, 0, ((((((8 + len(this.FirstName)) + 72) + 8) + 18) + 8) + 385)))\n\tif err = this.marshalTo(buf /*, addrs*/); err == nil {\n\t\tdata = buf.Bytes()\n\t}\n\treturn\n}",
"func (r Resource) MarshalBinary() ([]byte, error) {\n\tb := make([]byte, 4+32)\n\n\tif n := copy(b[0:2], MagicBytes[:]); n != 2 {\n\t\treturn nil, fmt.Errorf(\"unable to copy correct magic bytes\")\n\t}\n\tb[2] = binaryVersion\n\n\tid, err := r.ID.MarshalBinary()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"marshaling ID to binary: %+v\", err)\n\t}\n\tcopy(b[4:20], id)\n\n\tstatus, err := r.Status.MarshalBinary()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"marshaling Status to binary: %+v\", err)\n\t}\n\tcopy(b[20:21], status)\n\n\tsince, err := r.Since.MarshalBinary()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"marshaling Since to binary: %+v\", err)\n\t}\n\tcopy(b[21:36], since)\n\n\treturn b, nil\n}",
"func (ao *AttestationObject) MarshalBinary() (data []byte, err error) {\n\trawAuthData, _ := (&ao.AuthData).MarshalBinary() //cannot fail\n\n\tintermediate := encodingAttObj{\n\t\tAuthData: rawAuthData,\n\t\tFmt: ao.Fmt,\n\t\tAttStmt: ao.AttStmt,\n\t}\n\n\treturn cbor.Marshal(&intermediate, cbor.CTAP2EncOptions())\n}",
"func (this *family) MarshalBinary() (data []byte, err error) {\n\t// var addrs = map[uintptr]uint64{}\n\tbuf := bytes.NewBuffer(make([]byte, 0, ((8 + len(this.LastName)) + (8 + ((len(this.Pets) * 15) + (len(this.Pets) * 9))))))\n\tif err = this.marshalTo(buf /*, addrs*/); err == nil {\n\t\tdata = buf.Bytes()\n\t}\n\treturn\n}",
"func (r *RDS) MarshalBinary() ([]byte, error) {\n\tcontent, err := r.parser.Parse(rdsAddonPath, *r, template.WithFuncs(storageTemplateFunctions))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn content.Bytes(), nil\n}",
"func (t *Transaction) MarshalBinary() ([]byte, error) {\n\treturn json.Marshal(t)\n}",
"func (v RejoinCountExponent) MarshalBinary() ([]byte, error) {\n\treturn marshalBinaryEnum(int32(v)), nil\n}",
"func (t *TLV) MarshalBinary() []byte {\n\treturn nil\n}",
"func (share *RTGShare) MarshalBinary() ([]byte, error) {\n\tlenRing := share.Value[0].GetDataLen(true)\n\tdata := make([]byte, 8+lenRing*len(share.Value))\n\tbinary.BigEndian.PutUint64(data[:8], uint64(lenRing))\n\tptr := 8\n\tfor _, val := range share.Value {\n\t\tcnt, err := val.WriteTo(data[ptr : ptr+lenRing])\n\t\tif err != nil {\n\t\t\treturn []byte{}, err\n\t\t}\n\t\tptr += cnt\n\t}\n\n\treturn data, nil\n}",
"func (l *PropertyList) MarshalBinary() ([]byte, error) {\n\tvar buf bytes.Buffer\n\n\tfor _, p := range *l {\n\t\t// #nosec: Errors unhandled\n\t\tb, _ := p.MarshalBinary()\n\t\t// #nosec: Errors unhandled\n\t\t_, _ = buf.Write(b)\n\t}\n\n\treturn buf.Bytes(), nil\n}",
"func (dt DateTime) MarshalBinary() ([]byte, error) {\n\treturn dt.src.MarshalBinary()\n}",
"func (c Command) MarshalBinary() (b []byte, err error) {\r\n\tvar buf bytes.Buffer\r\n\tif _, err = c.WriteTo(&buf); err != nil {\r\n\t\treturn\r\n\t}\r\n\r\n\treturn buf.Bytes(), nil\r\n}",
"func (f *Frame) MarshalBinary() ([]byte, error) {\n\tb := make([]byte, f.length())\n\t_, err := f.read(b)\n\treturn b, err\n}",
"func (obj *Edge) MarshalBinary() ([]byte, error) {\n\t// A simple encoding: plain text.\n\tvar b bytes.Buffer\n\t_, err := fmt.Fprintln(&b, obj.isNew, obj.EntityKind, obj.virtualId, obj.version, obj.entityId, obj.EntityType,\n\t\tobj.isDeleted, obj.isInitialized, obj.graphMetadata, obj.attributes, obj.modifiedAttributes,\n\t\tobj.directionType, obj.fromNode, obj.toNode)\n\tif err != nil {\n\t\tlogger.Error(fmt.Sprintf(\"ERROR: Returning Edge:MarshalBinary w/ Error: '%+v'\", err.Error()))\n\t\treturn nil, err\n\t}\n\treturn b.Bytes(), nil\n}",
"func (m Dense) MarshalBinary() ([]byte, error) {\n\tbufLen := int64(m.mat.Rows)*int64(m.mat.Cols)*int64(sizeFloat64) + 2*int64(sizeInt64)\n\tif bufLen <= 0 {\n\t\t// bufLen is too big and has wrapped around.\n\t\treturn nil, errTooBig\n\t}\n\n\tp := 0\n\tbuf := make([]byte, bufLen)\n\tbinary.LittleEndian.PutUint64(buf[p:p+sizeInt64], uint64(m.mat.Rows))\n\tp += sizeInt64\n\tbinary.LittleEndian.PutUint64(buf[p:p+sizeInt64], uint64(m.mat.Cols))\n\tp += sizeInt64\n\n\tr, c := m.Dims()\n\tfor i := 0; i < r; i++ {\n\t\tfor j := 0; j < c; j++ {\n\t\t\tbinary.LittleEndian.PutUint64(buf[p:p+sizeFloat64], math.Float64bits(m.at(i, j)))\n\t\t\tp += sizeFloat64\n\t\t}\n\t}\n\n\treturn buf, nil\n}",
"func (p Attribute) MarshalBinary() ([]byte, error) {\n\t// good old [length|field] encoding. length is an uint64\n\tbyteName := []byte(p.Name)\n\tbyteTypename := []byte(p.Typename)\n\n\tb := make([]byte, len(byteName)+len(byteTypename)+len(p.Value)+3*8+1)\n\t// leading zeros are striped from big.Ints...\n\tb[0] = MagicByte\n\tindex := 1\n\n\tbinary.BigEndian.PutUint64(b[index:index+8], (uint64)(len(byteName)))\n\tindex += 8\n\tcopy(b[index:index+len(byteName)], byteName)\n\tindex += len(byteName)\n\n\tbinary.BigEndian.PutUint64(b[index:index+8], (uint64)(len(byteTypename)))\n\tindex += 8\n\tcopy(b[index:index+len(byteTypename)], byteTypename)\n\tindex += len(byteTypename)\n\n\tbinary.BigEndian.PutUint64(b[index:index+8], (uint64)(len(p.Value)))\n\tindex += 8\n\tcopy(b[index:index+len(p.Value)], p.Value)\n\treturn b, nil\n}",
"func (s *State) Serialize() []byte {\n\treturn s.serializer.Serialize(s.structure())\n}",
"func (addr DevAddr) MarshalBinary() ([]byte, error) {\n\treturn addr.Bytes(), nil\n}",
"func (bc *ByteCount) MarshalBinary() ([]byte, error) {\n\tb := make([]byte, 8)\n\tbinary.BigEndian.PutUint64(b, uint64(AtomicLoadByteCount(bc)))\n\treturn b, nil\n}",
"func (v MACVersion) MarshalBinary() ([]byte, error) {\n\treturn marshalBinaryEnum(int32(v)), nil\n}",
"func (s *FactoidTransactionSignature) MarshalBinary() ([]byte, error) {\n\tif !s.IsPopulated() {\n\t\treturn nil, fmt.Errorf(\"not populated\")\n\t}\n\n\trcdData, err := s.ReedeemCondition.MarshalBinary()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdata := make([]byte, len(rcdData)+len(s.SignatureBlock))\n\tvar i int\n\ti += copy(data[i:], rcdData)\n\ti += copy(data[i:], s.SignatureBlock)\n\treturn data, nil\n}",
"func (p *CompressedEdwardsY) MarshalBinary() ([]byte, error) {\n\tb := make([]byte, CompressedPointSize)\n\tcopy(b, p[:])\n\treturn b, nil\n}",
"func (c *Client) MarshalBinary() ([]byte, error) {\n\tc.mu.RLock()\n\tdefer c.mu.RUnlock()\n\treturn c.cacheData.MarshalBinary()\n}",
"func (a Address) MarshalBinary() ([]byte, error) {\n\treturn (address.Address)(a).MarshalBinary()\n}",
"func (t *TDigest) MarshalBinary() ([]byte, error) {\n\tt.process()\n\treturn marshalBinary(t)\n}",
"func (v RxDelayValue) MarshalBinary() ([]byte, error) {\n\treturn v.Value.MarshalBinary()\n}",
"func (d *Deal) MarshalBinary() ([]byte, error) {\n\tvar b bytes.Buffer\n\tbinary.Write(&b, binary.LittleEndian, d.Index)\n\tb.Write(d.Deal.Cipher)\n\treturn b.Bytes(), nil\n}",
"func (v Class) MarshalBinary() ([]byte, error) {\n\treturn marshalBinaryEnum(int32(v)), nil\n}",
"func (obj *BlobAttribute) MarshalBinary() ([]byte, error) {\n\t// A simple encoding: plain text.\n\tvar b bytes.Buffer\n\t_, err := fmt.Fprintln(&b, obj.owner, obj.attrDesc, obj.attrValue, obj.isModified, obj.entityId, obj.isCached)\n\tif err != nil {\n\t\tlogger.Error(fmt.Sprintf(\"ERROR: Returning BlobAttribute:MarshalBinary w/ Error: '%+v'\", err.Error()))\n\t\treturn nil, err\n\t}\n\treturn b.Bytes(), nil\n}",
"func (s ImpressionDTO) MarshalBinary() (data []byte, err error) {\n\treturn json.Marshal(s)\n}",
"func (pd *ProductData) MarshalBinary() ([]byte, error) {\n\tbuf := make([]byte, 7)\n\tcopy(buf[1:4], pd.Key[:])\n\tcopy(buf[4:6], pd.DevCat[:])\n\tbuf[6] = 0xff\n\treturn buf, nil\n}",
"func (v DataRateIndex) MarshalBinary() ([]byte, error) {\n\treturn marshalBinaryEnum(int32(v)), nil\n}",
"func (tx *Payment) MarshalBinary(Scheme) ([]byte, error) {\n\tb := tx.bodyMarshalBinaryBuffer()\n\terr := tx.bodyMarshalBinary(b)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbuf := make([]byte, paymentBodyLen+crypto.SignatureSize)\n\tcopy(buf, b)\n\tif tx.Signature == nil {\n\t\treturn nil, errors.New(\"marshaling unsigned transaction\")\n\t}\n\tcopy(buf[paymentBodyLen:], tx.Signature[:])\n\treturn buf, nil\n}",
"func (ps *GetProcedureState) Serialize() ([]byte, error) {\n\treq := &pb.GetProcedureResultRequest{\n\t\tProcId: &ps.procID,\n\t}\n\treturn proto.Marshal(req)\n}",
"func (image *Image) MarshalBinary() ([]byte, error) {\n\tbuffer := new(bytes.Buffer)\n\n\tformatLen := uint32(len(image.Format))\n\tbinary.Write(buffer, binary.LittleEndian, &formatLen)\n\tbuffer.Write([]byte(image.Format))\n\n\tdataLen := uint32(len(image.Data))\n\tbinary.Write(buffer, binary.LittleEndian, &dataLen)\n\tbuffer.Write(image.Data)\n\n\treturn buffer.Bytes(), nil\n}",
"func (v PingSlotPeriodValue) MarshalBinary() ([]byte, error) {\n\treturn v.Value.MarshalBinary()\n}",
"func (r *SbProxy) Serialize() rotator.Object {\n\tr.RLock()\n\tdefer r.RUnlock()\n\treturn r.serialize()\n}",
"func (s Snowflake) MarshalBinary() (data []byte, err error) {\n\treturn []byte(strconv.FormatUint(uint64(s), 2)), nil\n}",
"func (f *FactoidTransaction) MarshalBinary() ([]byte, error) {\n\t// TODO: More checks up front?\n\tif !f.IsPopulated() {\n\t\treturn nil, fmt.Errorf(\"not populated\")\n\t}\n\n\tdata, err := f.MarshalLedgerBinary()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, s := range f.Signatures {\n\t\tsig, err := s.MarshalBinary()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdata = append(data, sig...)\n\t}\n\n\treturn data, nil\n}",
"func (d *Data) MarshalBinary() ([]byte, error) {\n\tif len(d.Values) == 0 {\n\t\treturn []byte{}, nil\n\t}\n\tbuf := new(bytes.Buffer)\n\tfor key, value := range d.Values {\n\t\t// gotta check here because the Values map is exported and could be\n\t\t// modified underneath us\n\t\tif len(key.Name) == 0 {\n\t\t\treturn nil, fmt.Errorf(\"twig key cannot have empty name\")\n\t\t}\n\t\tbuf.WriteString(key.String())\n\t\tbuf.WriteByte(0)\n\t\tbuf.Write(value)\n\t\tbuf.WriteByte(0)\n\t}\n\t// hide the final NULL byte\n\treturn buf.Bytes()[:buf.Len()-1], nil\n}",
"func (v ADRAckDelayExponentValue) MarshalBinary() ([]byte, error) {\n\treturn v.Value.MarshalBinary()\n}",
"func (i State) MarshalText() ([]byte, error) {\n\treturn []byte(i.String()), nil\n}",
"func (v DeviceEIRP) MarshalBinary() ([]byte, error) {\n\treturn marshalBinaryEnum(int32(v)), nil\n}",
"func (e *Execution) Marshal() ([]byte, error) {\n\treturn e.MarshalSSZ()\n}",
"func (this *petHamster) MarshalBinary() (data []byte, err error) {\n\t// var addrs = map[uintptr]uint64{}\n\tbuf := bytes.NewBuffer(make([]byte, 0, ((29 + (8 + (len(this.pet.LastIllness.Notes) * 15))) + 17)))\n\tif err = this.marshalTo(buf /*, addrs*/); err == nil {\n\t\tdata = buf.Bytes()\n\t}\n\treturn\n}",
"func (b Bitfield) MarshalBinary() ([]byte, error) {\n\tvar buf bytes.Buffer\n\terr := binary.Write(&buf, binary.BigEndian, b.length)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = binary.Write(&buf, binary.BigEndian, b.Bytes())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf.Bytes(), nil\n}",
"func (v Vector) MarshalBinary() ([]byte, error) {\n\tbufLen := int64(sizeInt64) + int64(v.n)*int64(sizeFloat64)\n\tif bufLen <= 0 {\n\t\t// bufLen is too big and has wrapped around.\n\t\treturn nil, errTooBig\n\t}\n\n\tp := 0\n\tbuf := make([]byte, bufLen)\n\tbinary.LittleEndian.PutUint64(buf[p:p+sizeInt64], uint64(v.n))\n\tp += sizeInt64\n\n\tfor i := 0; i < v.n; i++ {\n\t\tbinary.LittleEndian.PutUint64(buf[p:p+sizeFloat64], math.Float64bits(v.at(i)))\n\t\tp += sizeFloat64\n\t}\n\n\treturn buf, nil\n}",
"func (*nopSerializer) Marshal(Message) ([]byte, error) { return nil, nil }",
"func (v DataRateIndexValue) MarshalBinary() ([]byte, error) {\n\treturn v.Value.MarshalBinary()\n}",
"func (v PingSlotPeriod) MarshalBinary() ([]byte, error) {\n\treturn marshalBinaryEnum(int32(v)), nil\n}",
"func (an *AdNetwork) MarshalBinary() (data []byte, err error) {\n\treturn ffjson.Marshal(an)\n}",
"func (s SplitDTO) MarshalBinary() (data []byte, err error) {\n\treturn json.Marshal(s)\n}",
"func (v RejoinTimeExponent) MarshalBinary() ([]byte, error) {\n\treturn marshalBinaryEnum(int32(v)), nil\n}"
] | [
"0.6328394",
"0.6176267",
"0.6165976",
"0.60621375",
"0.606017",
"0.60486805",
"0.60226256",
"0.59424466",
"0.59332556",
"0.5898915",
"0.58767116",
"0.58736074",
"0.58614975",
"0.5788809",
"0.57764137",
"0.5723125",
"0.56919384",
"0.56767684",
"0.5666373",
"0.56379133",
"0.56085974",
"0.5602532",
"0.5575602",
"0.5568863",
"0.5567335",
"0.5559056",
"0.55569637",
"0.55407727",
"0.5532909",
"0.55260485",
"0.552354",
"0.5507138",
"0.55009353",
"0.54919434",
"0.54904693",
"0.5486462",
"0.5484867",
"0.5482342",
"0.54649043",
"0.54544616",
"0.54474366",
"0.5441269",
"0.54387945",
"0.5435329",
"0.54338557",
"0.54300654",
"0.54267955",
"0.5426281",
"0.5422017",
"0.5415891",
"0.5405766",
"0.5403222",
"0.53983104",
"0.5397785",
"0.5390858",
"0.5387652",
"0.5374028",
"0.5364526",
"0.5359125",
"0.53534526",
"0.5349083",
"0.534463",
"0.53349483",
"0.53129286",
"0.5311139",
"0.5305247",
"0.52981764",
"0.52949464",
"0.52909285",
"0.5290224",
"0.5283516",
"0.5277204",
"0.5272112",
"0.52595216",
"0.52566016",
"0.5247548",
"0.5242508",
"0.5242209",
"0.523785",
"0.52309364",
"0.52240515",
"0.52169573",
"0.5205765",
"0.51954544",
"0.51922655",
"0.5184887",
"0.51764363",
"0.51708806",
"0.51635337",
"0.51613367",
"0.51597583",
"0.51507473",
"0.51487684",
"0.51442623",
"0.5136228",
"0.51304954",
"0.5127751",
"0.51272476",
"0.51241183",
"0.51118034"
] | 0.6075811 | 3 |
UnmarshalBinary sets the state of the generator to the state represented in data. | func (pcg *PCGSource) UnmarshalBinary(data []byte) error {
if len(data) < 16 {
return io.ErrUnexpectedEOF
}
pcg.low = binary.BigEndian.Uint64(data[8:])
pcg.high = binary.BigEndian.Uint64(data[:8])
return nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (v Palette) UnmarshalBinary(data []byte) error {\n\tif len(v)*3 != len(data) {\n\t\treturn fmt.Errorf(\"Len is not valid. required: %d, actual: %d\", len(v)*3, len(data))\n\t}\n\tfor i := 0; i < len(v); i++ {\n\t\tv[i].r = data[i*3]\n\t\tv[i].g = data[i*3+1]\n\t\tv[i].b = data[i*3+2]\n\t}\n\treturn nil\n}",
"func (tx *Genesis) UnmarshalBinary(data []byte, scheme Scheme) error {\n\tif l := len(data); l != genesisBodyLen {\n\t\treturn errors.Errorf(\"incorrect data length for Genesis transaction, expected %d, received %d\", genesisBodyLen, l)\n\t}\n\tif data[0] != byte(GenesisTransaction) {\n\t\treturn errors.Errorf(\"incorrect transaction type %d for Genesis transaction\", data[0])\n\t}\n\terr := tx.bodyUnmarshalBinary(data)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to unmarshal Genesis transaction from bytes\")\n\t}\n\terr = tx.GenerateSigID(scheme)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to unmarshal Genesis transaction from bytes\")\n\t}\n\treturn nil\n}",
"func (this *simWorld) UnmarshalBinary(data []byte) (err error) {\n\t// var addrs = map[uint64]uintptr{}\n\tvar pos0 int\n\terr = this.unmarshalFrom(&pos0, data /*, addrs*/)\n\treturn\n}",
"func (this *petHamster) UnmarshalBinary(data []byte) (err error) {\n\t// var addrs = map[uint64]uintptr{}\n\tvar pos0 int\n\terr = this.unmarshalFrom(&pos0, data /*, addrs*/)\n\treturn\n}",
"func (i *Transform) UnmarshalBinary(data []byte) error {\n\tvar err error\n\t*i, err = ParseTransformString(string(data))\n\treturn err\n}",
"func (self *stateRestIterator) UnmarshalData(bytes []byte) ([]interface{}, error) {\n\tvar response stateRestResponseMultiple\n\terr := json.Unmarshal(bytes, &response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresult := make([]interface{}, len(response.Data))\n\tfor i, item := range response.Data {\n\t\tdataBytes, err := base64.StdEncoding.DecodeString(item.Data)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult[i] = &types.State{Data: dataBytes, Address: item.Address, Head: response.Head}\n\t}\n\n\treturn result, nil\n}",
"func (share *RTGShare) UnmarshalBinary(data []byte) error {\n\tif len(data) <= 8 {\n\t\treturn errors.New(\"Unsufficient data length\")\n\t}\n\n\tlenRing := binary.BigEndian.Uint64(data[:8])\n\tvalLength := uint64(len(data)-8) / lenRing\n\tshare.Value = make([]*ring.Poly, valLength)\n\tptr := uint64(8)\n\tfor i := range share.Value {\n\t\tshare.Value[i] = new(ring.Poly)\n\t\terr := share.Value[i].UnmarshalBinary(data[ptr : ptr+lenRing])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tptr += lenRing\n\t}\n\n\treturn nil\n}",
"func (s *Side) UnmarshalBinary(data []byte) (err error) {\n\tif len(data) != 1 {\n\t\terr = fmt.Errorf(\"Error marshalling binary for a Side, length of data should be 1\")\n\t\treturn\n\t}\n\tif data[0] == 0x00 {\n\t\t*s = Sell\n\t\treturn\n\t} else if data[0] == 0x01 {\n\t\t*s = Buy\n\t\treturn\n\t}\n\terr = fmt.Errorf(\"Error unmarshalling Side, invalid data - should be 0x00 or 0x01\")\n\treturn\n}",
"func (b *BitStream) UnmarshalBinary(bIn []byte) error {\n\tbuf := bytes.NewReader(bIn)\n\terr := binary.Read(buf, binary.BigEndian, &b.count)\n\tif err != nil {\n\t\treturn err\n\t}\n\tb.stream = make([]byte, buf.Len())\n\terr = binary.Read(buf, binary.BigEndian, &b.stream)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}",
"func (id *ID) UnmarshalBinary(data []byte) error {\n\tdec := marshal.NewDecoder(data)\n\tid.Unmarshal(dec)\n\tif dec.Len() > 0 {\n\t\tlog.Panicf(\"Value.UnmarshalBinary: %dB garbage at the end\", dec.Len())\n\t}\n\tmarshal.ReleaseDecoder(dec)\n\treturn nil\n}",
"func (this *person) UnmarshalBinary(data []byte) (err error) {\n\t// var addrs = map[uint64]uintptr{}\n\tvar pos0 int\n\terr = this.unmarshalFrom(&pos0, data /*, addrs*/)\n\treturn\n}",
"func (s *SeriesIDSet) UnmarshalBinary(data []byte) error {\n\ts.Lock()\n\tdefer s.Unlock()\n\treturn s.bitmap.UnmarshalBinary(data)\n}",
"func Unmarshal(data []byte, v interface{}) error {\n\tvar d decodeState\n\td.init(data)\n\treturn d.unmarshal(v)\n}",
"func (p *CompressedEdwardsY) UnmarshalBinary(data []byte) error {\n\tp.Identity() // Foot + gun avoidance.\n\n\tvar ep EdwardsPoint\n\tif err := ep.UnmarshalBinary(data); err != nil {\n\t\treturn err\n\t}\n\n\t_, _ = p.SetBytes(data) // Can not fail.\n\n\treturn nil\n}",
"func (this *family) UnmarshalBinary(data []byte) (err error) {\n\t// var addrs = map[uint64]uintptr{}\n\tvar pos0 int\n\terr = this.unmarshalFrom(&pos0, data /*, addrs*/)\n\treturn\n}",
"func (d *Data) UnmarshalBinary(b []byte) error {\n\tif len(b) == 0 {\n\t\treturn nil\n\t}\n\tcomponents := bytes.Split(b, []byte{0})\n\tif len(components)%2 != 0 {\n\t\treturn fmt.Errorf(\"key with no value\")\n\t}\n\tfor i := 0; i < len(components); i += 2 {\n\t\tkey, err := FromString(string(components[i]))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed parsing key: %w\", err)\n\t\t}\n\t\td.Values[key] = components[i+1]\n\t}\n\treturn nil\n}",
"func (app *TokenAccountState) UnmarshalBinary(data []byte) error {\n\tif len(data) < tokenAccountStateLen {\n\t\treturn fmt.Errorf(\"invalid Token Data for unmarshalling %X on chain %X\", app.IssuerIdentity, app.IssuerChainId)\n\t}\n\n\ti := copy(app.IssuerIdentity[:], data[:])\n\ti += copy(app.IssuerChainId[:], data[i:])\n\n\tapp.Balance.SetBytes(data[i:])\n\ti += 32\n\n\tif len(data) > i {\n\t\tcoinbase := types.TokenIssuance{}\n\t\terr := coinbase.UnmarshalBinary(data[i:])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tapp.Coinbase = &coinbase\n\t}\n\n\treturn nil\n}",
"func (state *RequestContextBatchState) Unmarshal(data []byte) error {\n\t*state = RequestContextBatchState(data[0])\n\treturn nil\n}",
"func (src *MT19937_64) UnmarshalBinary(data []byte) error {\n\tif len(data) < (mt19937_64NN+1)*8 {\n\t\treturn io.ErrUnexpectedEOF\n\t}\n\tfor i := 0; i < mt19937_64NN; i++ {\n\t\tsrc.mt[i] = binary.BigEndian.Uint64(data[i*8 : (i+1)*8])\n\t}\n\tsrc.mti = binary.BigEndian.Uint64(data[mt19937_64NN*8:])\n\treturn nil\n}",
"func (f genHelperDecoder) DecBinaryUnmarshal(bm encoding.BinaryUnmarshaler) {\n\thalt.onerror(bm.UnmarshalBinary(f.d.d.DecodeBytes(nil)))\n}",
"func (v *Vector) UnmarshalBinary(data []byte) error {\n\tif !v.isZero() {\n\t\tpanic(\"mat64: unmarshal into non-zero vector\")\n\t}\n\n\tp := 0\n\tn := int64(binary.LittleEndian.Uint64(data[p : p+sizeInt64]))\n\tp += sizeInt64\n\tif n < 0 {\n\t\treturn errBadSize\n\t}\n\tif n > maxLen {\n\t\treturn errTooBig\n\t}\n\tif len(data) != int(n)*sizeFloat64+sizeInt64 {\n\t\treturn errBadBuffer\n\t}\n\n\tv.reuseAs(int(n))\n\tfor i := range v.mat.Data {\n\t\tv.mat.Data[i] = math.Float64frombits(binary.LittleEndian.Uint64(data[p : p+sizeFloat64]))\n\t\tp += sizeFloat64\n\t}\n\n\treturn nil\n}",
"func (t *Time) UnmarshalBinary(data []byte) error {}",
"func (r *RatchetState) Unmarshall(d []byte) *RatchetState {\n\tif len(d) != 136 {\n\t\treturn nil\n\t}\n\tnr := &RatchetState{\n\t\tcounter: binary.BigEndian.Uint64(d),\n\t}\n\tcopy(nr.static[:], d[8:])\n\tcopy(nr.dynamic[:], d[40:])\n\tcopy(nr.privateKey[:], d[72:])\n\tcopy(nr.PublicKey[:], d[104:])\n\treturn nr\n}",
"func (i *IATA) UnmarshalBinary(b []byte) error {\n\t// IATA must contain at least an IAID.\n\tif len(b) < 4 {\n\t\treturn io.ErrUnexpectedEOF\n\t}\n\n\tiaid := [4]byte{}\n\tcopy(iaid[:], b[0:4])\n\ti.IAID = iaid\n\n\toptions, err := parseOptions(b[4:])\n\tif err != nil {\n\t\treturn err\n\t}\n\ti.Options = options\n\n\treturn nil\n}",
"func (b *Balance) UnmarshalBinary(text []byte) error {\n\tif b.Int != nil {\n\t\tb.Int = nil\n\t}\n\tb.Int = new(big.Int).SetBytes(text)\n\treturn nil\n}",
"func (s *State) Unmarshall(d []byte) *State {\n\tif len(d) != 136 {\n\t\treturn nil\n\t}\n\tns := &State{\n\t\tcounter: binary.BigEndian.Uint64(d),\n\t}\n\tcopy(ns.static[:], d[8:])\n\tcopy(ns.dynamic[:], d[40:])\n\tcopy(ns.privateKey[:], d[72:])\n\tcopy(ns.PublicKey[:], d[104:])\n\treturn ns\n}",
"func (this *hobby) UnmarshalBinary(data []byte) (err error) {\n\t// var addrs = map[uint64]uintptr{}\n\tvar pos0 int\n\terr = this.unmarshalFrom(&pos0, data /*, addrs*/)\n\treturn\n}",
"func Unmarshal([]byte) (WireMessage, error) { return nil, nil }",
"func (g *Name) UnmarshalBinary(data []byte) error {\n\tif len(data) != grammemeNameLength {\n\t\treturn fmt.Errorf(\"%w: expected 4 bytes, not %d\", common.ErrUnmarshal, len(data))\n\t}\n\n\treturn g.UnmarshalFromBuffer(binutils.NewBuffer(data))\n}",
"func (v *DataRateOffset) UnmarshalBinary(b []byte) error {\n\ti, err := unmarshalEnumFromBinary(\"DataRateOffset\", DataRateOffset_name, b)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*v = DataRateOffset(i)\n\treturn nil\n}",
"func (id *MessageID) UnmarshalBinary(data []byte) (err error) {\n\tif len(data) != MessageIDLength {\n\t\terr = fmt.Errorf(\"data must be exactly %d long to encode a valid message id\", MessageIDLength)\n\t\treturn\n\t}\n\tcopy(id[:], data)\n\n\treturn\n}",
"func (t *TDigest) UnmarshalBinary(p []byte) error {\n\treturn unmarshalBinary(t, p)\n}",
"func (lump *Generic) Unmarshall(data []byte) (err error) {\n\tlump.length = len(data)\n\tlump.data = data\n\n\treturn err\n}",
"func (g *Generic) UnmarshalBinary(b []byte) error {\n\tvar err error\n\tg.Header, err = ParseHeader(b)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tprs, err := params.ParseMultiParams(g.Header.Payload)\n\tif err != nil {\n\t\treturn err\n\t}\n\tg.Params = append(g.Params, prs...)\n\treturn nil\n}",
"func (p *Pending) UnmarshalBinary(data []byte) error {\n\treader := bytes.NewReader(data)\n\n\tp.Address = make(wallet.Address, wallet.AddressSize)\n\tif _, err := reader.Read(p.Address); err != nil {\n\t\treturn err\n\t}\n\n\tbalance := make([]byte, wallet.BalanceSize)\n\tif _, err := reader.Read(balance); err != nil {\n\t\treturn err\n\t}\n\tif err := p.Amount.UnmarshalBinary(balance); err != nil {\n\t\treturn err\n\t}\n\n\treturn util.AssertReaderEOF(reader)\n}",
"func (p *privateKey) UnmarshalBinary(data []byte) (err error) {\n\tp.PrivateKey, err = keys.NewPrivateKeyFromBytes(data)\n\treturn\n}",
"func (o *Organism) UnmarshalBinary(data []byte) error {\n\t// A simple encoding: plain text.\n\tb := bytes.NewBuffer(data)\n\tvar genotype_id int\n\t_, err := fmt.Fscanln(b, &o.Fitness, &o.Generation, &o.highestFitness, &o.isPopulationChampionChild, &genotype_id)\n\to.Genotype, err = ReadGenome(b, genotype_id)\n\tif err == nil {\n\t\to.Phenotype, err = o.Genotype.Genesis(genotype_id)\n\t}\n\n\treturn err\n}",
"func (m *Dense) UnmarshalBinary(data []byte) error {\n\tif !m.isZero() {\n\t\tpanic(\"mat64: unmarshal into non-zero matrix\")\n\t}\n\n\tif len(data) < 2*sizeInt64 {\n\t\treturn errTooSmall\n\t}\n\n\tp := 0\n\trows := int64(binary.LittleEndian.Uint64(data[p : p+sizeInt64]))\n\tp += sizeInt64\n\tcols := int64(binary.LittleEndian.Uint64(data[p : p+sizeInt64]))\n\tp += sizeInt64\n\tif rows < 0 || cols < 0 {\n\t\treturn errBadSize\n\t}\n\n\tsize := rows * cols\n\tif int(size) < 0 || size > maxLen {\n\t\treturn errTooBig\n\t}\n\n\tif len(data) != int(size)*sizeFloat64+2*sizeInt64 {\n\t\treturn errBadBuffer\n\t}\n\n\tm.reuseAs(int(rows), int(cols))\n\tfor i := range m.mat.Data {\n\t\tm.mat.Data[i] = math.Float64frombits(binary.LittleEndian.Uint64(data[p : p+sizeFloat64]))\n\t\tp += sizeFloat64\n\t}\n\n\treturn nil\n}",
"func (v *MACCommandIdentifier) UnmarshalBinary(b []byte) error {\n\ti, err := unmarshalEnumFromBinary(\"MACCommandIdentifier\", MACCommandIdentifier_name, b)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*v = MACCommandIdentifier(i)\n\treturn nil\n}",
"func (v *PHYVersion) UnmarshalBinary(b []byte) error {\n\ti, err := unmarshalEnumFromBinary(\"PHYVersion\", PHYVersion_name, b)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*v = PHYVersion(i)\n\treturn nil\n}",
"func (s *Series) UnmarshalBinary(b []byte) error {\n\tbuf := bytes.NewReader(b)\n\tem := &errMarshal{r: buf}\n\tem.read(&s.T0)\n\tem.read(&s.leading)\n\tem.read(&s.t)\n\tem.read(&s.tDelta)\n\tem.read(&s.trailing)\n\tem.read(&s.val)\n\toutBuf := make([]byte, buf.Len())\n\tem.read(outBuf)\n\terr := s.bw.UnmarshalBinary(outBuf)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif em.err != nil {\n\t\treturn em.err\n\t}\n\treturn nil\n}",
"func (this *pet) UnmarshalBinary(data []byte) (err error) {\n\t// var addrs = map[uint64]uintptr{}\n\tvar pos0 int\n\terr = this.unmarshalFrom(&pos0, data /*, addrs*/)\n\treturn\n}",
"func (tx *Payment) UnmarshalBinary(data []byte, scheme Scheme) error {\n\tsize := paymentBodyLen + crypto.SignatureSize\n\tif l := len(data); l != size {\n\t\treturn errors.Errorf(\"not enough data for Payment transaction, expected %d, received %d\", size, l)\n\t}\n\tif data[0] != byte(PaymentTransaction) {\n\t\treturn errors.Errorf(\"incorrect transaction type %d for Payment transaction\", data[0])\n\t}\n\terr := tx.bodyUnmarshalBinary(data[:paymentBodyLen])\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to unmarshal Payment transaction from bytes\")\n\t}\n\tdata = data[paymentBodyLen:]\n\tvar s crypto.Signature\n\tcopy(s[:], data[:crypto.SignatureSize])\n\ttx.Signature = &s\n\terr = tx.GenerateID(scheme)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to unmarshal Payment transaction from bytes\")\n\t}\n\treturn nil\n}",
"func (this *school) UnmarshalBinary(data []byte) (err error) {\n\t// var addrs = map[uint64]uintptr{}\n\tvar pos0 int\n\terr = this.unmarshalFrom(&pos0, data /*, addrs*/)\n\treturn\n}",
"func (d *Data) Unmarshal(b []byte) error {\n\treturn nil\n}",
"func (t *TLV) UnmarshalBinary(b []byte) error {\n\treturn nil\n}",
"func (v *MType) UnmarshalBinary(b []byte) error {\n\ti, err := unmarshalEnumFromBinary(\"MType\", MType_name, b)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*v = MType(i)\n\treturn nil\n}",
"func (this *petPiranha) UnmarshalBinary(data []byte) (err error) {\n\t// var addrs = map[uint64]uintptr{}\n\tvar pos0 int\n\terr = this.unmarshalFrom(&pos0, data /*, addrs*/)\n\treturn\n}",
"func (v *DataRateIndex) UnmarshalBinary(b []byte) error {\n\ti, err := unmarshalEnumFromBinary(\"DataRateIndex\", DataRateIndex_name, b)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*v = DataRateIndex(i)\n\treturn nil\n}",
"func (pd *ProductData) UnmarshalBinary(buf []byte) error {\n\tif len(buf) < 14 {\n\t\treturn newBufError(ErrBufferTooShort, 14, len(buf))\n\t}\n\n\tcopy(pd.Key[:], buf[1:4])\n\tcopy(pd.DevCat[:], buf[4:6])\n\treturn nil\n}",
"func (eb *EBlock) UnmarshalBinary(data []byte) error {\n\tif len(data) < EBlockMinTotalLen {\n\t\treturn fmt.Errorf(\"insufficient length\")\n\t}\n\tif len(data) > EBlockMaxTotalLen {\n\t\treturn fmt.Errorf(\"invalid length\")\n\t}\n\tif eb.ChainID == nil {\n\t\teb.ChainID = new(Bytes32)\n\t}\n\teb.ChainID = eb.ChainID\n\ti := copy(eb.ChainID[:], data[:len(eb.ChainID)])\n\teb.BodyMR = new(Bytes32)\n\ti += copy(eb.BodyMR[:], data[i:i+len(eb.BodyMR)])\n\teb.PrevKeyMR = new(Bytes32)\n\ti += copy(eb.PrevKeyMR[:], data[i:i+len(eb.PrevKeyMR)])\n\teb.PrevFullHash = new(Bytes32)\n\ti += copy(eb.PrevFullHash[:], data[i:i+len(eb.PrevFullHash)])\n\teb.Sequence = binary.BigEndian.Uint32(data[i : i+4])\n\ti += 4\n\teb.Height = binary.BigEndian.Uint32(data[i : i+4])\n\ti += 4\n\teb.ObjectCount = binary.BigEndian.Uint32(data[i : i+4])\n\ti += 4\n\tif len(data[i:]) != int(eb.ObjectCount*32) {\n\t\treturn fmt.Errorf(\"invalid length\")\n\t}\n\n\t// Parse all objects into Bytes32\n\tobjects := make([]Bytes32, eb.ObjectCount)\n\tmaxMinute := Bytes32{31: 10}\n\tvar numMins int\n\tfor oi := range objects {\n\t\tobj := &objects[len(objects)-1-oi] // Reverse object order\n\t\ti += copy(obj[:], data[i:i+len(obj)])\n\t\tif bytes.Compare(obj[:], maxMinute[:]) <= 0 {\n\t\t\tnumMins++\n\t\t}\n\t}\n\tif bytes.Compare(objects[0][:], maxMinute[:]) > 0 {\n\t\treturn fmt.Errorf(\"invalid minute marker\")\n\t}\n\n\t// Populate Entries from objects.\n\teb.Entries = make([]Entry, int(eb.ObjectCount)-numMins)\n\tei := len(eb.Entries) - 1\n\tvar ts time.Time\n\tfor _, obj := range objects {\n\t\tif bytes.Compare(obj[:], maxMinute[:]) <= 0 {\n\t\t\tts = eb.Timestamp.\n\t\t\t\tAdd(time.Duration(obj[31]) * time.Minute)\n\t\t\tcontinue\n\t\t}\n\t\te := &eb.Entries[ei]\n\t\te.Timestamp = ts\n\t\te.ChainID = eb.ChainID\n\t\te.Height = eb.Height\n\t\tobj := obj\n\t\te.Hash = &obj\n\t\tei--\n\t}\n\treturn nil\n}",
"func (v *DataRateOffsetValue) UnmarshalBinary(b []byte) error {\n\tvar vv DataRateOffset\n\tif err := vv.UnmarshalBinary(b); err != nil {\n\t\treturn err\n\t}\n\t*v = DataRateOffsetValue{\n\t\tValue: vv,\n\t}\n\treturn nil\n}",
"func (u *UUID) UnmarshalBinary(data []byte) error {\n\tif len(data) != len(u) {\n\t\treturn ErrInvalidUUID\n\t}\n\tcopy(u[:], data)\n\treturn nil\n}",
"func (bp *BasePayload) UnmarshalBinary(data []byte) error {\n\tif err := json.Unmarshal(data, bp); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}",
"func (bc *ByteCount) UnmarshalBinary(data []byte) error {\n\tif len(data) != 8 {\n\t\treturn fmt.Errorf(\"invalid len: %d\", len(data))\n\t}\n\tAtomicStoreByteCount(bc, ByteCount(binary.BigEndian.Uint64(data)))\n\treturn nil\n}",
"func (f *IndexFile) UnmarshalBinary(data []byte) error {\n\t// Ensure magic number exists at the beginning.\n\tif len(data) < len(FileSignature) {\n\t\treturn io.ErrShortBuffer\n\t} else if !bytes.Equal(data[:len(FileSignature)], []byte(FileSignature)) {\n\t\treturn ErrInvalidIndexFile\n\t}\n\n\t// Read index file trailer.\n\tt, err := ReadIndexFileTrailer(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Slice measurement block data.\n\tbuf := data[t.MeasurementBlock.Offset:]\n\tbuf = buf[:t.MeasurementBlock.Size]\n\n\t// Unmarshal measurement block.\n\tif err := f.mblk.UnmarshalBinary(buf); err != nil {\n\t\treturn err\n\t}\n\n\t// Unmarshal each tag block.\n\tf.tblks = make(map[string]*TagBlock)\n\titr := f.mblk.Iterator()\n\n\tfor m := itr.Next(); m != nil; m = itr.Next() {\n\t\te := m.(*MeasurementBlockElem)\n\n\t\t// Slice measurement block data.\n\t\tbuf := data[e.tagBlock.offset:]\n\t\tbuf = buf[:e.tagBlock.size]\n\n\t\t// Unmarshal measurement block.\n\t\tvar tblk TagBlock\n\t\tif err := tblk.UnmarshalBinary(buf); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tf.tblks[string(e.name)] = &tblk\n\t}\n\n\t// Slice series list data.\n\tbuf = data[t.SeriesBlock.Offset:]\n\tbuf = buf[:t.SeriesBlock.Size]\n\n\t// Unmarshal series list.\n\tif err := f.sblk.UnmarshalBinary(buf); err != nil {\n\t\treturn err\n\t}\n\n\t// Save reference to entire data block.\n\tf.data = data\n\n\treturn nil\n}",
"func (image *Image) UnmarshalBinary(data []byte) error {\n\tdataPosition := 0\n\treadData := func(length int) ([]byte, error) {\n\t\tdataEnd := dataPosition + length\n\t\tif dataEnd > len(data) {\n\t\t\treturn nil, fmt.Errorf(\"unexpected end of data at index %d instead of %d\", len(data), dataEnd)\n\t\t}\n\t\td := data[dataPosition:dataEnd]\n\t\tdataPosition = dataEnd\n\t\treturn d, nil\n\t}\n\n\tvar imageFormatLength uint32\n\tif d, err := readData(4); err == nil {\n\t\tbinary.Read(bytes.NewReader(d), binary.LittleEndian, &imageFormatLength)\n\t} else {\n\t\treturn err\n\t}\n\n\tif d, err := readData(int(imageFormatLength)); err == nil {\n\t\timage.Format = string(d)\n\t} else {\n\t\treturn err\n\t}\n\n\tvar imageDataLength uint32\n\tif d, err := readData(4); err == nil {\n\t\tbinary.Read(bytes.NewReader(d), binary.LittleEndian, &imageDataLength)\n\t} else {\n\t\treturn err\n\t}\n\n\tif d, err := readData(int(imageDataLength)); err == nil {\n\t\timage.Data = d\n\t} else {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func (p *PushDataPacket) UnmarshalBinary(data []byte) error {\n\tif len(data) < 13 {\n\t\treturn errors.New(\"backend/semtechudp/packets: at least 13 bytes are expected\")\n\t}\n\tif data[3] != byte(PushData) {\n\t\treturn errors.New(\"backend/semtechudp/packets: identifier mismatch (PUSH_DATA expected)\")\n\t}\n\n\tif !protocolSupported(data[0]) {\n\t\treturn ErrInvalidProtocolVersion\n\t}\n\n\tp.ProtocolVersion = data[0]\n\tp.RandomToken = binary.LittleEndian.Uint16(data[1:3])\n\tfor i := 0; i < 8; i++ {\n\t\tp.GatewayMAC[i] = data[4+i]\n\t}\n\n\treturn json.Unmarshal(data[12:], &p.Payload)\n}",
"func (p *Pattern) UnmarshalBinary(data []byte) error {\n\tp.buffer = bytes.NewReader(data)\n\n\tp.checkHeader()\n\n\tlength := p.readLength()\n\tmaxOffset := p.currentOffset() + length\n\n\tp.readVersion()\n\tp.readTempo()\n\n\tfor p.currentOffset() < maxOffset {\n\t\tp.readTrack()\n\t}\n\n\treturn p.lastErr\n}",
"func (m *Sign1) UnmarshalBinary(data []byte) error {\n\tvar err error\n\n\tif len(data) != sizeSign1 {\n\t\treturn fmt.Errorf(\"msg1: %w\", ErrInvalidMessage)\n\t}\n\n\t_, err = m.Di.SetCanonicalBytes(data[:32])\n\tif err != nil {\n\t\treturn fmt.Errorf(\"msg1.D: %w\", err)\n\t}\n\n\t_, err = m.Ei.SetCanonicalBytes(data[32:])\n\tif err != nil {\n\t\treturn fmt.Errorf(\"msg1.E: %w\", err)\n\t}\n\n\treturn nil\n}",
"func (sk *PrivateKey) UnmarshalBinary(data []byte) error {\n\tif len(data) != PrivateKeySize {\n\t\treturn errors.New(\"packed private key must be of eddilithium2.PrivateKeySize bytes\")\n\t}\n\tvar buf [PrivateKeySize]byte\n\tcopy(buf[:], data)\n\tsk.Unpack(&buf)\n\treturn nil\n}",
"func (s *Specification) UnmarshalBinary(data []byte) error {\n\tif err := json.Unmarshal(data, s); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func (*nopSerializer) Unmarshal([]byte, Message) error { return nil }",
"func (d *Decimal) UnmarshalBinary(data []byte) error {\n\t// Verify we have at least 4 bytes for the exponent. The GOB encoded value\n\t// may be empty.\n\tif len(data) < 4 {\n\t\treturn fmt.Errorf(\"error decoding binary %v: expected at least 4 bytes, got %d\", data, len(data))\n\t}\n\n\t// Extract the exponent\n\td.exp = int32(binary.BigEndian.Uint32(data[:4]))\n\n\t// Extract the value\n\td.value = new(big.Int)\n\tif err := d.value.GobDecode(data[4:]); err != nil {\n\t\treturn fmt.Errorf(\"error decoding binary %v: %s\", data, err)\n\t}\n\n\treturn nil\n}",
"func (b *Bitmap) UnmarshalBinary(data []byte) error {\n\tif data == nil {\n\t\t// Nothing to unmarshal\n\t\treturn nil\n\t}\n\tstatsHit(\"Bitmap/UnmarshalBinary\")\n\tb.opN = 0 // reset opN since we're reading new data.\n\tfileMagic := uint32(binary.LittleEndian.Uint16(data[0:2]))\n\tif fileMagic == MagicNumber { // if pilosa roaring\n\t\treturn errors.Wrap(b.unmarshalPilosaRoaring(data), \"unmarshaling as pilosa roaring\")\n\t}\n\n\tkeyN, containerTyper, header, pos, haveRuns, err := readOfficialHeader(data)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"reading roaring header\")\n\t}\n\t// Only the Pilosa roaring format has flags. The official Roaring format\n\t// hasn't got space in its header for flags.\n\tb.Flags = 0\n\n\tb.Containers.ResetN(int(keyN))\n\t// Descriptive header section: Read container keys and cardinalities.\n\tfor i, buf := uint(0), data[header:]; i < uint(keyN); i, buf = i+1, buf[4:] {\n\t\tcard := int(binary.LittleEndian.Uint16(buf[2:4])) + 1\n\t\tb.Containers.PutContainerValues(\n\t\t\tuint64(binary.LittleEndian.Uint16(buf[0:2])),\n\t\t\tcontainerTyper(i, card), /// container type voodo with isRunBitmap\n\t\t\tcard,\n\t\t\ttrue)\n\t}\n\n\t// Read container offsets and attach data.\n\tif haveRuns {\n\t\terr := readWithRuns(b, data, pos, keyN)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"reading offsets from official roaring format\")\n\t\t}\n\t} else {\n\t\terr := readOffsets(b, data, pos, keyN)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"reading official roaring format\")\n\t\t}\n\t}\n\treturn nil\n}",
"func (d *RegistrationResultPayload) UnmarshalBinary(b []byte) error {\n\tps, err := ParseMultiParams(b)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(ps) != 3 {\n\t\treturn ErrInvalidLength\n\t}\n\n\td.LocalRoutingKeyIdentifier = ps[0]\n\td.RegistrationStatus = ps[1]\n\td.RoutingContext = ps[2]\n\n\treturn nil\n}",
"func SetUnmarshal(u func(line []byte, v interface{}) error) {\n\tlock.Lock()\n\tunmarshaller = u\n\tlock.Unlock()\n}",
"func (m queueMapPtr) UnmarshalBinary(data []byte) error {\n\tm.Clear()\n\tidx := 0\n\n\t// number of elements\n\tsz := int(binary.LittleEndian.Uint32(data[idx:]))\n\tif sz == 0 {\n\t\treturn nil\n\t}\n\tidx += 4\n\n\tfor i := 0; i < sz; i++ {\n\t\t// name\n\t\tsz := int(binary.LittleEndian.Uint32(data[idx:]))\n\t\tidx += 4\n\t\tb := make([]byte, sz)\n\t\tcopy(b, data[idx:idx+sz])\n\t\tn := string(b)\n\t\tidx += sz\n\n\t\t// number of elements\n\t\tsz = int(binary.LittleEndian.Uint32(data[idx:]))\n\t\tidx += 4\n\n\t\tr := newQueueRecord()\n\n\t\t// elements\n\t\tfor j := 0; j < sz; j++ {\n\t\t\te := entry{}\n\t\t\tsz := int(binary.LittleEndian.Uint32(data[idx:]))\n\t\t\tidx += 4\n\n\t\t\tb := make([]byte, sz)\n\t\t\tcopy(b, data[idx:idx+sz])\n\t\t\te.Value = b\n\t\t\tidx += sz\n\n\t\t\te.TTLMillis = int64(binary.LittleEndian.Uint64(data[idx:]))\n\t\t\tidx += 8\n\n\t\t\tr.Offer(&e)\n\t\t}\n\n\t\tm.Put(n, r)\n\t}\n\n\treturn nil\n}",
"func (id *ObjectID) UnmarshalBinary(data []byte) error {\n\tif len(data) < ObjectIDMinLength {\n\t\treturn ErrTruncatedData\n\t}\n\tid.Value = unmarshalGUID(data[0:16])\n\tif len(data) >= 32 {\n\t\tid.BirthVolumeID = unmarshalGUID(data[16:32])\n\t}\n\tif len(data) >= 48 {\n\t\tid.BirthObjectID = unmarshalGUID(data[32:48])\n\t}\n\tif len(data) >= 64 {\n\t\tid.DomainID = unmarshalGUID(data[48:64])\n\t}\n\treturn nil\n}",
"func (ao *AttestationObject) UnmarshalBinary(data []byte) error {\n\tintermediate := encodingAttObj{}\n\tif err := cbor.Unmarshal(data, &intermediate); err != nil {\n\t\treturn ErrUnmarshalAttestationObject.Wrap(err)\n\t}\n\n\tif err := (&ao.AuthData).UnmarshalBinary(intermediate.AuthData); err != nil {\n\t\treturn ErrUnmarshalAttestationObject.Wrap(err)\n\t}\n\n\tao.Fmt = intermediate.Fmt\n\tao.AttStmt = intermediate.AttStmt\n\treturn nil\n}",
"func (v *DataRateIndexValue) UnmarshalBinary(b []byte) error {\n\tvar vv DataRateIndex\n\tif err := vv.UnmarshalBinary(b); err != nil {\n\t\treturn err\n\t}\n\t*v = DataRateIndexValue{\n\t\tValue: vv,\n\t}\n\treturn nil\n}",
"func Unmarshal(data []byte, o interface{}) error {\n\tbuf := bytes.NewBuffer(data)\n\tdecoder := gob.NewDecoder(buf)\n\n\terr := decoder.Decode(o)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func (b *BootImageID) Unmarshal(buf *uio.Lexer) error {\n\tbyte0 := buf.Read8()\n\t_ = buf.Read8()\n\tb.IsInstall = byte0&0x80 != 0\n\tb.ImageType = BootImageType(byte0 & 0x7f)\n\tb.Index = buf.Read16()\n\treturn buf.Error()\n}",
"func (v *MACVersion) UnmarshalBinary(b []byte) error {\n\ti, err := unmarshalEnumFromBinary(\"MACVersion\", MACVersion_name, b)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*v = MACVersion(i)\n\treturn nil\n}",
"func (an *AdNetwork) UnmarshalBinary(data []byte) (err error) {\n\treturn ffjson.Unmarshal(data, an)\n}",
"func (this *city) UnmarshalBinary(data []byte) (err error) {\n\t// var addrs = map[uint64]uintptr{}\n\tvar pos0 int\n\terr = this.unmarshalFrom(&pos0, data /*, addrs*/)\n\treturn\n}",
"func Unmarshal(data []byte) Flag {\n\treturn Flag(binary.LittleEndian.Uint16(data[0:2]))\n}",
"func (v *Class) UnmarshalBinary(b []byte) error {\n\ti, err := unmarshalEnumFromBinary(\"Class\", Class_name, b)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*v = Class(i)\n\treturn nil\n}",
"func (dt *DateTime) UnmarshalBinary(data []byte) error {\n\treturn dt.src.UnmarshalBinary(data)\n}",
"func (this *fixedSize) UnmarshalBinary(data []byte) (err error) {\n\t// var addrs = map[uint64]uintptr{}\n\tvar pos0 int\n\terr = this.unmarshalFrom(&pos0, data /*, addrs*/)\n\treturn\n}",
"func (m *MsgProofs) Unmarshal(b []byte) error {\n\treturn m.UnmarshalSSZ(b)\n}",
"func (obj *ServerMemoryInfoImpl) UnmarshalBinary(data []byte) error {\n\t// A simple encoding: plain text.\n\tb := bytes.NewBuffer(data)\n\t_, err := fmt.Fscanln(b, &obj.processMemory, &obj.sharedMemory)\n\tif err != nil {\n\t\tlogger.Error(fmt.Sprintf(\"ERROR: Returning ServerMemoryInfoImpl:UnmarshalBinary w/ Error: '%+v'\", err.Error()))\n\t\treturn err\n\t}\n\treturn nil\n}",
"func (c *Digest) UnmarshalBinary(data []byte) (err error) {\n\tconst (\n\t\toffsetAttempt = 0\n\t\toffsetHeight = offsetAttempt + common.Uint16ByteSize\n\t\toffsetExternalChainHeight = offsetHeight + common.Uint64ByteSize\n\t\toffsetAuthorPosition = offsetExternalChainHeight + common.Uint64ByteSize\n\t\toffsetObserversConfHash = offsetAuthorPosition + common.Uint16ByteSize\n\t\toffsetBlockHash = offsetObserversConfHash + hash.BytesSize\n\t\toffsetClaimsSize = offsetBlockHash + hash.BytesSize\n\t\toffsetVariadicLengthData = offsetClaimsSize + common.Uint16ByteSize\n\t)\n\n\tc.Attempt, err = utils.UnmarshalUint16(data[offsetAttempt:offsetHeight])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tc.Index, err = utils.UnmarshalUint64(data[offsetHeight:offsetExternalChainHeight])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tc.ExternalChainHeight, err = utils.UnmarshalUint64(data[offsetExternalChainHeight:offsetAuthorPosition])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tc.AuthorObserverIndex, err = utils.UnmarshalUint16(data[offsetAuthorPosition:offsetObserversConfHash])\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = c.ObserversConfHash.UnmarshalBinary(data[offsetObserversConfHash:offsetBlockHash])\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = c.BlockHash.UnmarshalBinary(data[offsetBlockHash:offsetClaimsSize])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tclaimsDataSegmentSize, err := utils.UnmarshalUint16(data[offsetClaimsSize:offsetVariadicLengthData])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tclaimsDataSegmentOffset := uint16(offsetVariadicLengthData)\n\tTSLsDataOffset := claimsDataSegmentOffset + claimsDataSegmentSize\n\n\terr = c.ClaimsHashes.UnmarshalBinary(data[claimsDataSegmentOffset:TSLsDataOffset])\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = c.TSLsHashes.UnmarshalBinary(data[TSLsDataOffset:])\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn\n}",
"func (t *TPDU) UnmarshalBinary(b []byte) error {\n\tvar err error\n\tt.Header, err = ParseHeader(b)\n\tif err != nil {\n\t\treturn err\n\t}\n\tt.Payload = t.Header.Payload\n\n\treturn nil\n}",
"func (p *PooledUnmarshaller) Unmarshal(b []byte, obj interface{}) error {\n\tu := p.pool.Get().(*Unmarshaller)\n\terr := u.Unmarshal(b, obj)\n\tp.pool.Put(u)\n\treturn err\n}",
"func (s *Series) UnmarshalBinary(buf []byte) error {\n\tvar pb internal.Series\n\tif err := proto.Unmarshal(buf, &pb); err != nil {\n\t\treturn err\n\t}\n\ts.Key = pb.GetKey()\n\ts.Tags = make(map[string]string)\n\tfor _, t := range pb.Tags {\n\t\ts.Tags[t.GetKey()] = t.GetValue()\n\t}\n\treturn nil\n}",
"func (s *State) DecodeData(data []byte, dest interface{}) error {\n\tdecoder := gob.NewDecoder(bytes.NewReader(data))\n\terr := decoder.Decode(dest)\n\treturn err\n}",
"func (f *STAGFields) UnmarshalBinary(b []byte) error {\n\tl := len(b)\n\tif l < 3 {\n\t\treturn io.ErrUnexpectedEOF\n\t}\n\n\tf.Flags = b[0]\n\toffset := 1\n\n\tif f.HasPCP() {\n\t\tf.PCP = b[offset] & 0x07\n\t}\n\n\tif f.HasDEI() {\n\t\tf.DEIFlag = (b[offset] >> 3) & 0x01\n\t}\n\n\tif f.HasVID() {\n\t\tf.CVID = binary.BigEndian.Uint16(b[offset:offset+2]) & 0xf0ff\n\t}\n\n\treturn nil\n}",
"func (v *DeviceEIRP) UnmarshalBinary(b []byte) error {\n\ti, err := unmarshalEnumFromBinary(\"DeviceEIRP\", DeviceEIRP_name, b)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*v = DeviceEIRP(i)\n\treturn nil\n}",
"func (s *SeriesIDSet) UnmarshalBinaryUnsafe(data []byte) error {\n\ts.Lock()\n\tdefer s.Unlock()\n\t_, err := s.bitmap.FromBuffer(data)\n\treturn err\n}",
"func (b *Bitfield) UnmarshalBinary(data []byte) error {\n\tbuf := bytes.NewBuffer(data)\n\terr := binary.Read(buf, binary.BigEndian, &b.length)\n\tif err != nil {\n\t\treturn err\n\t}\n\tb.Bitfield = bitfield.NewBytes(buf.Bytes(), b.length)\n\treturn nil\n}",
"func (p *EdwardsPoint) UnmarshalBinary(data []byte) error {\n\tp.Identity() // Foot + gun avoidance.\n\n\tvar cp CompressedEdwardsY\n\tif _, err := cp.SetBytes(data); err != nil {\n\t\treturn nil\n\t}\n\t_, err := p.SetCompressedY(&cp)\n\treturn err\n}",
"func Unmarshal(b []byte, v interface{}) (err error) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tif je, ok := r.(error); ok {\n\t\t\t\terr = fmt.Errorf(\"%s, bianay %v, destType %T\", je.Error(), b, v)\n\t\t\t} else {\n\t\t\t\terr = fmt.Errorf(\"%v, bianay %v, destType %T\", r, b, v)\n\t\t\t}\n\t\t}\n\t}()\n\t// Get the decoder from the pool, reset it\n\td := decoders.Get().(*Decoder)\n\td.r.(*reader).Reset(b) // Reset the reader\n\n\t// Decode and set the buffer if successful and free the decoder\n\terr = d.Decode(v)\n\tdecoders.Put(d)\n\treturn\n}",
"func (e EmptyNode) DecodeBinary(*io.BinReader) {\n}",
"func (obj *Edge) UnmarshalBinary(data []byte) error {\n\t// A simple encoding: plain text.\n\tb := bytes.NewBuffer(data)\n\t_, err := fmt.Fscanln(b, &obj.isNew, &obj.EntityKind, &obj.virtualId, &obj.version, &obj.entityId, &obj.EntityType,\n\t\t&obj.isDeleted, &obj.isInitialized, &obj.graphMetadata, &obj.attributes, &obj.modifiedAttributes,\n\t\t&obj.directionType, &obj.fromNode, &obj.toNode)\n\tif err != nil {\n\t\tlogger.Error(fmt.Sprintf(\"ERROR: Returning Edge:UnmarshalBinary w/ Error: '%+v'\", err.Error()))\n\t\treturn err\n\t}\n\treturn nil\n}",
"func (init *FuseInitIn) ParseBinary(bcontent []byte) error {\n\terr := common.ParseBinary(bcontent, init)\n\n\treturn err\n}",
"func (d *DateTime) UnmarshalBinary(data []byte) error {\n\treturn d.Time.UnmarshalText(data)\n}",
"func (nf *NetworkPayload) UnmarshalBinary(data []byte) error {\n\tif err := json.Unmarshal(data, nf); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}",
"func (pk *PublicKey) UnmarshalBinary(data []byte) error {\n\tif len(data) != PublicKeySize {\n\t\treturn errors.New(\"packed public key must be of eddilithium2.PublicKeySize bytes\")\n\t}\n\tvar buf [PublicKeySize]byte\n\tcopy(buf[:], data)\n\tpk.Unpack(&buf)\n\treturn nil\n}",
"func (i *IE) UnmarshalBinary(b []byte) error {\n\tl := len(b)\n\tif l < 4 {\n\t\treturn io.ErrUnexpectedEOF\n\t}\n\n\ti.Type = binary.BigEndian.Uint16(b[0:2])\n\ti.Length = binary.BigEndian.Uint16(b[2:4])\n\n\toffset := 4\n\tend := int(i.Length)\n\tif i.IsVendorSpecific() && l >= 6 {\n\t\ti.EnterpriseID = binary.BigEndian.Uint16(b[4:6])\n\t\toffset += 2\n\t\tend -= 2\n\t}\n\n\tif l <= offset {\n\t\treturn nil\n\t}\n\n\tif l < offset+end {\n\t\treturn io.ErrUnexpectedEOF\n\t}\n\n\ti.Payload = b[offset : offset+end]\n\n\tif i.IsGrouped() {\n\t\tvar err error\n\t\ti.ChildIEs, err = ParseMultiIEs(i.Payload)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}"
] | [
"0.6078023",
"0.5822415",
"0.57675517",
"0.5730266",
"0.57153803",
"0.5686104",
"0.5648046",
"0.56441903",
"0.5585511",
"0.55330825",
"0.55255497",
"0.55208737",
"0.5503409",
"0.54295784",
"0.5417937",
"0.5416214",
"0.5415113",
"0.536192",
"0.5359965",
"0.53555477",
"0.5352008",
"0.5350026",
"0.5347611",
"0.5345571",
"0.5334789",
"0.5332323",
"0.5329388",
"0.53278184",
"0.52966166",
"0.52804893",
"0.5275314",
"0.52621025",
"0.5256421",
"0.5255345",
"0.525033",
"0.5246384",
"0.5244853",
"0.52374077",
"0.5236858",
"0.5228822",
"0.5227403",
"0.52226585",
"0.5210743",
"0.51956594",
"0.51896745",
"0.51835316",
"0.5179691",
"0.51675415",
"0.51658815",
"0.5155288",
"0.5155029",
"0.5152885",
"0.51412857",
"0.5140715",
"0.5121848",
"0.5120056",
"0.51081836",
"0.5105617",
"0.5103148",
"0.51023114",
"0.51002854",
"0.5096537",
"0.50811577",
"0.50802046",
"0.50563973",
"0.50466937",
"0.5034429",
"0.5024052",
"0.5020191",
"0.5013486",
"0.5010356",
"0.5006976",
"0.5000521",
"0.4999561",
"0.49888366",
"0.4987967",
"0.4985877",
"0.49746835",
"0.49664438",
"0.49597383",
"0.4946249",
"0.4940609",
"0.49289578",
"0.49143463",
"0.49062157",
"0.49043792",
"0.49025482",
"0.49017534",
"0.48987678",
"0.489575",
"0.4894418",
"0.48942274",
"0.4894146",
"0.489349",
"0.4888729",
"0.48843518",
"0.4881469",
"0.48776993",
"0.48595983",
"0.48529685"
] | 0.5605674 | 8 |
XXX_OneofFuncs is for the internal use of the proto package. | func (*ConfigSource) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _ConfigSource_OneofMarshaler, _ConfigSource_OneofUnmarshaler, _ConfigSource_OneofSizer, []interface{}{
(*ConfigSource_Path)(nil),
(*ConfigSource_ApiConfigSource)(nil),
(*ConfigSource_Ads)(nil),
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (*EncapVal) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _EncapVal_OneofMarshaler, _EncapVal_OneofUnmarshaler, _EncapVal_OneofSizer, []interface{}{\n\t\t(*EncapVal_VlanId)(nil),\n\t\t(*EncapVal_MPLSTag)(nil),\n\t\t(*EncapVal_Vnid)(nil),\n\t\t(*EncapVal_QinQ)(nil),\n\t}\n}",
"func (*FlowL4Info) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _FlowL4Info_OneofMarshaler, _FlowL4Info_OneofUnmarshaler, _FlowL4Info_OneofSizer, []interface{}{\n\t\t(*FlowL4Info_TcpUdpInfo)(nil),\n\t\t(*FlowL4Info_IcmpInfo)(nil),\n\t}\n}",
"func (*Msg) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Msg_OneofMarshaler, _Msg_OneofUnmarshaler, _Msg_OneofSizer, []interface{}{\n\t\t(*Msg_Request)(nil),\n\t\t(*Msg_Preprepare)(nil),\n\t\t(*Msg_Prepare)(nil),\n\t\t(*Msg_Commit)(nil),\n\t\t(*Msg_ViewChange)(nil),\n\t\t(*Msg_NewView)(nil),\n\t\t(*Msg_Checkpoint)(nil),\n\t\t(*Msg_Hello)(nil),\n\t}\n}",
"func (*RuleL4Match) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _RuleL4Match_OneofMarshaler, _RuleL4Match_OneofUnmarshaler, _RuleL4Match_OneofSizer, []interface{}{\n\t\t(*RuleL4Match_Ports)(nil),\n\t\t(*RuleL4Match_TypeCode)(nil),\n\t}\n}",
"func (*Example) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Example_OneofMarshaler, _Example_OneofUnmarshaler, _Example_OneofSizer, []interface{}{\n\t\t(*Example_ImagePayload)(nil),\n\t\t(*Example_TextPayload)(nil),\n\t\t(*Example_VideoPayload)(nil),\n\t\t(*Example_AudioPayload)(nil),\n\t}\n}",
"func (*Metric) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Metric_OneofMarshaler, _Metric_OneofUnmarshaler, _Metric_OneofSizer, []interface{}{\n\t\t(*Metric_StringData)(nil),\n\t\t(*Metric_Float32Data)(nil),\n\t\t(*Metric_Float64Data)(nil),\n\t\t(*Metric_Int32Data)(nil),\n\t\t(*Metric_Int64Data)(nil),\n\t\t(*Metric_BytesData)(nil),\n\t\t(*Metric_BoolData)(nil),\n\t\t(*Metric_Uint32Data)(nil),\n\t\t(*Metric_Uint64Data)(nil),\n\t}\n}",
"func (*Metadata) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Metadata_OneofMarshaler, _Metadata_OneofUnmarshaler, _Metadata_OneofSizer, []interface{}{\n\t\t(*Metadata_DevAddrPrefix)(nil),\n\t\t(*Metadata_AppId)(nil),\n\t\t(*Metadata_AppEui)(nil),\n\t}\n}",
"func (*Interface) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Interface_OneofMarshaler, _Interface_OneofUnmarshaler, _Interface_OneofSizer, []interface{}{\n\t\t(*Interface_Sub)(nil),\n\t\t(*Interface_Memif)(nil),\n\t\t(*Interface_Afpacket)(nil),\n\t\t(*Interface_Tap)(nil),\n\t\t(*Interface_Vxlan)(nil),\n\t\t(*Interface_Ipsec)(nil),\n\t\t(*Interface_VmxNet3)(nil),\n\t}\n}",
"func (*Message) XXX_OneofFuncs() (func(msg proto1.Message, b *proto1.Buffer) error, func(msg proto1.Message, tag, wire int, b *proto1.Buffer) (bool, error), func(msg proto1.Message) (n int), []interface{}) {\n\treturn _Message_OneofMarshaler, _Message_OneofUnmarshaler, _Message_OneofSizer, []interface{}{\n\t\t(*Message_ExecStarted)(nil),\n\t\t(*Message_ExecCompleted)(nil),\n\t\t(*Message_ExecOutput)(nil),\n\t\t(*Message_LogEntry)(nil),\n\t\t(*Message_Error)(nil),\n\t}\n}",
"func (*Message) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Message_OneofMarshaler, _Message_OneofUnmarshaler, _Message_OneofSizer, []interface{}{\n\t\t(*Message_Chunk)(nil),\n\t\t(*Message_Status)(nil),\n\t}\n}",
"func (*Message) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Message_OneofMarshaler, _Message_OneofUnmarshaler, _Message_OneofSizer, []interface{}{\n\t\t(*Message_OpenPayload)(nil),\n\t\t(*Message_ClosePayload)(nil),\n\t\t(*Message_DataPayload)(nil),\n\t}\n}",
"func (*BMRPCRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _BMRPCRequest_OneofMarshaler, _BMRPCRequest_OneofUnmarshaler, _BMRPCRequest_OneofSizer, []interface{}{\n\t\t(*BMRPCRequest_Newaddress)(nil),\n\t\t(*BMRPCRequest_Help)(nil),\n\t\t(*BMRPCRequest_Listaddresses)(nil),\n\t}\n}",
"func (*Interface) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Interface_OneofMarshaler, _Interface_OneofUnmarshaler, _Interface_OneofSizer, []interface{}{\n\t\t(*Interface_Sub)(nil),\n\t\t(*Interface_Memif)(nil),\n\t\t(*Interface_Afpacket)(nil),\n\t\t(*Interface_Tap)(nil),\n\t\t(*Interface_Vxlan)(nil),\n\t\t(*Interface_Ipsec)(nil),\n\t\t(*Interface_VmxNet3)(nil),\n\t\t(*Interface_Bond)(nil),\n\t}\n}",
"func (*OpenStatusUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _OpenStatusUpdate_OneofMarshaler, _OpenStatusUpdate_OneofUnmarshaler, _OpenStatusUpdate_OneofSizer, []interface{}{\n\t\t(*OpenStatusUpdate_ChanPending)(nil),\n\t\t(*OpenStatusUpdate_ChanOpen)(nil),\n\t}\n}",
"func (*OpenStatusUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _OpenStatusUpdate_OneofMarshaler, _OpenStatusUpdate_OneofUnmarshaler, _OpenStatusUpdate_OneofSizer, []interface{}{\n\t\t(*OpenStatusUpdate_ChanPending)(nil),\n\t\t(*OpenStatusUpdate_ChanOpen)(nil),\n\t}\n}",
"func (*OpenStatusUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _OpenStatusUpdate_OneofMarshaler, _OpenStatusUpdate_OneofUnmarshaler, _OpenStatusUpdate_OneofSizer, []interface{}{\n\t\t(*OpenStatusUpdate_ChanPending)(nil),\n\t\t(*OpenStatusUpdate_ChanOpen)(nil),\n\t}\n}",
"func (*StatTable) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _StatTable_OneofMarshaler, _StatTable_OneofUnmarshaler, _StatTable_OneofSizer, []interface{}{\n\t\t(*StatTable_PodGroup_)(nil),\n\t}\n}",
"func (*Bitmessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Bitmessage_OneofMarshaler, _Bitmessage_OneofUnmarshaler, _Bitmessage_OneofSizer, []interface{}{\n\t\t(*Bitmessage_Text)(nil),\n\t}\n}",
"func (*WriteReq) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _WriteReq_OneofMarshaler, _WriteReq_OneofUnmarshaler, _WriteReq_OneofSizer, []interface{}{\n\t\t(*WriteReq_Name)(nil),\n\t\t(*WriteReq_Blob)(nil),\n\t}\n}",
"func (*RunnerMsg) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _RunnerMsg_OneofMarshaler, _RunnerMsg_OneofUnmarshaler, _RunnerMsg_OneofSizer, []interface{}{\n\t\t(*RunnerMsg_Acknowledged)(nil),\n\t\t(*RunnerMsg_ResultStart)(nil),\n\t\t(*RunnerMsg_Data)(nil),\n\t\t(*RunnerMsg_Finished)(nil),\n\t}\n}",
"func (*DiscoveryInfo) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _DiscoveryInfo_OneofMarshaler, _DiscoveryInfo_OneofUnmarshaler, _DiscoveryInfo_OneofSizer, []interface{}{\n\t\t(*DiscoveryInfo_Inflated)(nil),\n\t\t(*DiscoveryInfo_BlobAdded)(nil),\n\t\t(*DiscoveryInfo_BlobRemoved)(nil),\n\t}\n}",
"func (*Event) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Event_OneofMarshaler, _Event_OneofUnmarshaler, _Event_OneofSizer, []interface{}{\n\t\t(*Event_Read_)(nil),\n\t\t(*Event_Write_)(nil),\n\t}\n}",
"func (*OpenStatusUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _OpenStatusUpdate_OneofMarshaler, _OpenStatusUpdate_OneofUnmarshaler, _OpenStatusUpdate_OneofSizer, []interface{}{\n\t\t(*OpenStatusUpdate_ChanPending)(nil),\n\t\t(*OpenStatusUpdate_Confirmation)(nil),\n\t\t(*OpenStatusUpdate_ChanOpen)(nil),\n\t}\n}",
"func (*OpenStatusUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _OpenStatusUpdate_OneofMarshaler, _OpenStatusUpdate_OneofUnmarshaler, _OpenStatusUpdate_OneofSizer, []interface{}{\n\t\t(*OpenStatusUpdate_ChanPending)(nil),\n\t\t(*OpenStatusUpdate_Confirmation)(nil),\n\t\t(*OpenStatusUpdate_ChanOpen)(nil),\n\t}\n}",
"func (*OpenStatusUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _OpenStatusUpdate_OneofMarshaler, _OpenStatusUpdate_OneofUnmarshaler, _OpenStatusUpdate_OneofSizer, []interface{}{\n\t\t(*OpenStatusUpdate_ChanPending)(nil),\n\t\t(*OpenStatusUpdate_Confirmation)(nil),\n\t\t(*OpenStatusUpdate_ChanOpen)(nil),\n\t}\n}",
"func (*OpenStatusUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _OpenStatusUpdate_OneofMarshaler, _OpenStatusUpdate_OneofUnmarshaler, _OpenStatusUpdate_OneofSizer, []interface{}{\n\t\t(*OpenStatusUpdate_ChanPending)(nil),\n\t\t(*OpenStatusUpdate_Confirmation)(nil),\n\t\t(*OpenStatusUpdate_ChanOpen)(nil),\n\t}\n}",
"func (*TwoOneofs) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _TwoOneofs_OneofMarshaler, _TwoOneofs_OneofUnmarshaler, _TwoOneofs_OneofSizer, []interface{}{\n\t\t(*TwoOneofs_Field1)(nil),\n\t\t(*TwoOneofs_Field2)(nil),\n\t\t(*TwoOneofs_Field3)(nil),\n\t\t(*TwoOneofs_Field34)(nil),\n\t\t(*TwoOneofs_Field35)(nil),\n\t\t(*TwoOneofs_SubMessage2)(nil),\n\t}\n}",
"func (*TwoOneofs) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _TwoOneofs_OneofMarshaler, _TwoOneofs_OneofUnmarshaler, _TwoOneofs_OneofSizer, []interface{}{\n\t\t(*TwoOneofs_Field1)(nil),\n\t\t(*TwoOneofs_Field2)(nil),\n\t\t(*TwoOneofs_Field3)(nil),\n\t\t(*TwoOneofs_Field34)(nil),\n\t\t(*TwoOneofs_Field35)(nil),\n\t\t(*TwoOneofs_SubMessage2)(nil),\n\t}\n}",
"func (*TwoOneofs) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _TwoOneofs_OneofMarshaler, _TwoOneofs_OneofUnmarshaler, _TwoOneofs_OneofSizer, []interface{}{\n\t\t(*TwoOneofs_Field1)(nil),\n\t\t(*TwoOneofs_Field2)(nil),\n\t\t(*TwoOneofs_Field3)(nil),\n\t\t(*TwoOneofs_Field34)(nil),\n\t\t(*TwoOneofs_Field35)(nil),\n\t\t(*TwoOneofs_SubMessage2)(nil),\n\t}\n}",
"func (*TwoOneofs) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _TwoOneofs_OneofMarshaler, _TwoOneofs_OneofUnmarshaler, _TwoOneofs_OneofSizer, []interface{}{\n\t\t(*TwoOneofs_Field1)(nil),\n\t\t(*TwoOneofs_Field2)(nil),\n\t\t(*TwoOneofs_Field3)(nil),\n\t\t(*TwoOneofs_Field34)(nil),\n\t\t(*TwoOneofs_Field35)(nil),\n\t\t(*TwoOneofs_SubMessage2)(nil),\n\t}\n}",
"func (*TwoOneofs) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _TwoOneofs_OneofMarshaler, _TwoOneofs_OneofUnmarshaler, _TwoOneofs_OneofSizer, []interface{}{\n\t\t(*TwoOneofs_Field1)(nil),\n\t\t(*TwoOneofs_Field2)(nil),\n\t\t(*TwoOneofs_Field3)(nil),\n\t\t(*TwoOneofs_Field34)(nil),\n\t\t(*TwoOneofs_Field35)(nil),\n\t\t(*TwoOneofs_SubMessage2)(nil),\n\t}\n}",
"func (*TwoOneofs) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _TwoOneofs_OneofMarshaler, _TwoOneofs_OneofUnmarshaler, _TwoOneofs_OneofSizer, []interface{}{\n\t\t(*TwoOneofs_Field1)(nil),\n\t\t(*TwoOneofs_Field2)(nil),\n\t\t(*TwoOneofs_Field3)(nil),\n\t\t(*TwoOneofs_Field34)(nil),\n\t\t(*TwoOneofs_Field35)(nil),\n\t\t(*TwoOneofs_SubMessage2)(nil),\n\t}\n}",
"func (*Message) XXX_OneofFuncs() (func(msg proto1.Message, b *proto1.Buffer) error, func(msg proto1.Message, tag, wire int, b *proto1.Buffer) (bool, error), func(msg proto1.Message) (n int), []interface{}) {\n\treturn _Message_OneofMarshaler, _Message_OneofUnmarshaler, _Message_OneofSizer, []interface{}{\n\t\t(*Message_Signin)(nil),\n\t\t(*Message_Chatmsg)(nil),\n\t}\n}",
"func (*EvalRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _EvalRequest_OneofMarshaler, _EvalRequest_OneofUnmarshaler, _EvalRequest_OneofSizer, []interface{}{\n\t\t(*EvalRequest_ParsedExpr)(nil),\n\t\t(*EvalRequest_CheckedExpr)(nil),\n\t}\n}",
"func (*Header) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Header_OneofMarshaler, _Header_OneofUnmarshaler, _Header_OneofSizer, []interface{}{\n\t\t(*Header_Version)(nil),\n\t\t(*Header_SourceType)(nil),\n\t\t(*Header_EventType)(nil),\n\t}\n}",
"func (*LoggingPayloadData) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _LoggingPayloadData_OneofMarshaler, _LoggingPayloadData_OneofUnmarshaler, _LoggingPayloadData_OneofSizer, []interface{}{\n\t\t(*LoggingPayloadData_Msg)(nil),\n\t\t(*LoggingPayloadData_Raw)(nil),\n\t}\n}",
"func (*ReadModifyWriteRule) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _ReadModifyWriteRule_OneofMarshaler, _ReadModifyWriteRule_OneofUnmarshaler, _ReadModifyWriteRule_OneofSizer, []interface{}{\n\t\t(*ReadModifyWriteRule_AppendValue)(nil),\n\t\t(*ReadModifyWriteRule_IncrementAmount)(nil),\n\t}\n}",
"func (*BitmessageRPC) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _BitmessageRPC_OneofMarshaler, _BitmessageRPC_OneofUnmarshaler, _BitmessageRPC_OneofSizer, []interface{}{\n\t\t(*BitmessageRPC_Request)(nil),\n\t\t(*BitmessageRPC_Reply)(nil),\n\t\t(*BitmessageRPC_Push)(nil),\n\t}\n}",
"func (*SetConfigRequest_Entry) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _SetConfigRequest_Entry_OneofMarshaler, _SetConfigRequest_Entry_OneofUnmarshaler, _SetConfigRequest_Entry_OneofSizer, []interface{}{\n\t\t(*SetConfigRequest_Entry_ValueStr)(nil),\n\t\t(*SetConfigRequest_Entry_ValueInt32)(nil),\n\t\t(*SetConfigRequest_Entry_ValueBool)(nil),\n\t}\n}",
"func (*HealthCheck_Payload) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _HealthCheck_Payload_OneofMarshaler, _HealthCheck_Payload_OneofUnmarshaler, _HealthCheck_Payload_OneofSizer, []interface{}{\n\t\t(*HealthCheck_Payload_Text)(nil),\n\t\t(*HealthCheck_Payload_Binary)(nil),\n\t}\n}",
"func (*FlowKey) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _FlowKey_OneofMarshaler, _FlowKey_OneofUnmarshaler, _FlowKey_OneofSizer, []interface{}{\n\t\t(*FlowKey_IPFlowKey)(nil),\n\t\t(*FlowKey_MACFlowKey)(nil),\n\t}\n}",
"func (*Metadata) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Metadata_OneofMarshaler, _Metadata_OneofUnmarshaler, _Metadata_OneofSizer, []interface{}{\n\t\t(*Metadata_GatewayID)(nil),\n\t\t(*Metadata_DevAddrPrefix)(nil),\n\t\t(*Metadata_AppID)(nil),\n\t\t(*Metadata_AppEUI)(nil),\n\t}\n}",
"func (*LeafStat) XXX_OneofFuncs() (func(msg proto1.Message, b *proto1.Buffer) error, func(msg proto1.Message, tag, wire int, b *proto1.Buffer) (bool, error), func(msg proto1.Message) (n int), []interface{}) {\n\treturn _LeafStat_OneofMarshaler, _LeafStat_OneofUnmarshaler, _LeafStat_OneofSizer, []interface{}{\n\t\t(*LeafStat_Classification)(nil),\n\t\t(*LeafStat_Regression)(nil),\n\t}\n}",
"func (*BitcoinRules) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _BitcoinRules_OneofMarshaler, _BitcoinRules_OneofUnmarshaler, _BitcoinRules_OneofSizer, []interface{}{\n\t\t(*BitcoinRules_Address)(nil),\n\t\t(*BitcoinRules_String_)(nil),\n\t}\n}",
"func (*PolicyUpdateRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _PolicyUpdateRequest_OneofMarshaler, _PolicyUpdateRequest_OneofUnmarshaler, _PolicyUpdateRequest_OneofSizer, []interface{}{\n\t\t(*PolicyUpdateRequest_Global)(nil),\n\t\t(*PolicyUpdateRequest_ChanPoint)(nil),\n\t}\n}",
"func (*PolicyUpdateRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _PolicyUpdateRequest_OneofMarshaler, _PolicyUpdateRequest_OneofUnmarshaler, _PolicyUpdateRequest_OneofSizer, []interface{}{\n\t\t(*PolicyUpdateRequest_Global)(nil),\n\t\t(*PolicyUpdateRequest_ChanPoint)(nil),\n\t}\n}",
"func (*PolicyUpdateRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _PolicyUpdateRequest_OneofMarshaler, _PolicyUpdateRequest_OneofUnmarshaler, _PolicyUpdateRequest_OneofSizer, []interface{}{\n\t\t(*PolicyUpdateRequest_Global)(nil),\n\t\t(*PolicyUpdateRequest_ChanPoint)(nil),\n\t}\n}",
"func (*PolicyUpdateRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _PolicyUpdateRequest_OneofMarshaler, _PolicyUpdateRequest_OneofUnmarshaler, _PolicyUpdateRequest_OneofSizer, []interface{}{\n\t\t(*PolicyUpdateRequest_Global)(nil),\n\t\t(*PolicyUpdateRequest_ChanPoint)(nil),\n\t}\n}",
"func (*TriggerMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _TriggerMessage_OneofMarshaler, _TriggerMessage_OneofUnmarshaler, _TriggerMessage_OneofSizer, []interface{}{\n\t\t(*TriggerMessage_Topic)(nil),\n\t\t(*TriggerMessage_Type)(nil),\n\t\t(*TriggerMessage_Event)(nil),\n\t\t(*TriggerMessage_BodyBytes)(nil),\n\t\t(*TriggerMessage_Offset)(nil),\n\t\t(*TriggerMessage_Extensions)(nil),\n\t\t(*TriggerMessage_Uuid)(nil),\n\t\t(*TriggerMessage_Bid)(nil),\n\t}\n}",
"func (*Params) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Params_OneofMarshaler, _Params_OneofUnmarshaler, _Params_OneofSizer, []interface{}{\n\t\t(*Params_AppCredentials)(nil),\n\t\t(*Params_ApiKey)(nil),\n\t\t(*Params_ServiceAccountPath)(nil),\n\t}\n}",
"func (*Component) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Component_OneofMarshaler, _Component_OneofUnmarshaler, _Component_OneofSizer, []interface{}{\n\t\t(*Component_AppengineModule)(nil),\n\t\t(*Component_GkePod)(nil),\n\t}\n}",
"func (*Event) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Event_OneofMarshaler, _Event_OneofUnmarshaler, _Event_OneofSizer, []interface{}{\n\t\t(*Event_Register)(nil),\n\t\t(*Event_Block)(nil),\n\t\t(*Event_ChaincodeEvent)(nil),\n\t\t(*Event_Rejection)(nil),\n\t\t(*Event_Unregister)(nil),\n\t}\n}",
"func (*Event) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Event_OneofMarshaler, _Event_OneofUnmarshaler, _Event_OneofSizer, []interface{}{\n\t\t(*Event_Register)(nil),\n\t\t(*Event_Block)(nil),\n\t\t(*Event_ChaincodeEvent)(nil),\n\t\t(*Event_Rejection)(nil),\n\t\t(*Event_Unregister)(nil),\n\t}\n}",
"func (*InternalRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _InternalRequest_OneofMarshaler, _InternalRequest_OneofUnmarshaler, _InternalRequest_OneofSizer, []interface{}{\n\t\t(*InternalRequest_PutReq)(nil),\n\t\t(*InternalRequest_GetReq)(nil),\n\t\t(*InternalRequest_DeleteReq)(nil),\n\t}\n}",
"func (*Message) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Message_OneofMarshaler, _Message_OneofUnmarshaler, _Message_OneofSizer, []interface{}{\n\t\t(*Message_Transfer)(nil),\n\t\t(*Message_Account)(nil),\n\t}\n}",
"func (*StateKey) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _StateKey_OneofMarshaler, _StateKey_OneofUnmarshaler, _StateKey_OneofSizer, []interface{}{\n\t\t(*StateKey_Runner_)(nil),\n\t\t(*StateKey_MultimapSideInput_)(nil),\n\t\t(*StateKey_BagUserState_)(nil),\n\t}\n}",
"func (*StateKey) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _StateKey_OneofMarshaler, _StateKey_OneofUnmarshaler, _StateKey_OneofSizer, []interface{}{\n\t\t(*StateKey_Runner_)(nil),\n\t\t(*StateKey_MultimapSideInput_)(nil),\n\t\t(*StateKey_BagUserState_)(nil),\n\t}\n}",
"func (*TapEvent) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _TapEvent_OneofMarshaler, _TapEvent_OneofUnmarshaler, _TapEvent_OneofSizer, []interface{}{\n\t\t(*TapEvent_Http_)(nil),\n\t}\n}",
"func (*TapEvent) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _TapEvent_OneofMarshaler, _TapEvent_OneofUnmarshaler, _TapEvent_OneofSizer, []interface{}{\n\t\t(*TapEvent_Http_)(nil),\n\t}\n}",
"func (*TapEvent) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _TapEvent_OneofMarshaler, _TapEvent_OneofUnmarshaler, _TapEvent_OneofSizer, []interface{}{\n\t\t(*TapEvent_Http_)(nil),\n\t}\n}",
"func (*VideoAdInfo) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _VideoAdInfo_OneofMarshaler, _VideoAdInfo_OneofUnmarshaler, _VideoAdInfo_OneofSizer, []interface{}{\n\t\t(*VideoAdInfo_InStream)(nil),\n\t}\n}",
"func (*UploadBinaryRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _UploadBinaryRequest_OneofMarshaler, _UploadBinaryRequest_OneofUnmarshaler, _UploadBinaryRequest_OneofSizer, []interface{}{\n\t\t(*UploadBinaryRequest_Key_)(nil),\n\t\t(*UploadBinaryRequest_Chunk_)(nil),\n\t}\n}",
"func (*Metric) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Metric_OneofMarshaler, _Metric_OneofUnmarshaler, _Metric_OneofSizer, []interface{}{\n\t\t(*Metric_I64)(nil),\n\t\t(*Metric_U64)(nil),\n\t\t(*Metric_F64)(nil),\n\t\t(*Metric_String_)(nil),\n\t\t(*Metric_Bool)(nil),\n\t\t(*Metric_Duration)(nil),\n\t}\n}",
"func (*SendBitmessageRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _SendBitmessageRequest_OneofMarshaler, _SendBitmessageRequest_OneofUnmarshaler, _SendBitmessageRequest_OneofSizer, []interface{}{\n\t\t(*SendBitmessageRequest_Text)(nil),\n\t}\n}",
"func (*Service) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Service_OneofMarshaler, _Service_OneofUnmarshaler, _Service_OneofSizer, []interface{}{\n\t\t(*Service_DstPort)(nil),\n\t\t(*Service_IcmpMsgType)(nil),\n\t}\n}",
"func (*Event) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Event_OneofMarshaler, _Event_OneofUnmarshaler, _Event_OneofSizer, []interface{}{\n\t\t(*Event_Error)(nil),\n\t\t(*Event_Progress)(nil),\n\t\t(*Event_Match)(nil),\n\t\t(*Event_Pagination)(nil),\n\t}\n}",
"func (*Config) XXX_OneofFuncs() (func(msg proto1.Message, b *proto1.Buffer) error, func(msg proto1.Message, tag, wire int, b *proto1.Buffer) (bool, error), func(msg proto1.Message) (n int), []interface{}) {\n\treturn _Config_OneofMarshaler, _Config_OneofUnmarshaler, _Config_OneofSizer, []interface{}{\n\t\t(*Config_Custom)(nil),\n\t\t(*Config_Random)(nil),\n\t\t(*Config_Fixed)(nil),\n\t}\n}",
"func (*FetchRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _FetchRequest_OneofMarshaler, _FetchRequest_OneofUnmarshaler, _FetchRequest_OneofSizer, []interface{}{\n\t\t(*FetchRequest_TagMatchers)(nil),\n\t}\n}",
"func (*Message) XXX_OneofFuncs() (func(msg proto1.Message, b *proto1.Buffer) error, func(msg proto1.Message, tag, wire int, b *proto1.Buffer) (bool, error), func(msg proto1.Message) (n int), []interface{}) {\n\treturn _Message_OneofMarshaler, _Message_OneofUnmarshaler, _Message_OneofSizer, []interface{}{\n\t\t(*Message_Bigint)(nil),\n\t\t(*Message_EcGroupElement)(nil),\n\t\t(*Message_Status)(nil),\n\t\t(*Message_PedersenFirst)(nil),\n\t\t(*Message_PedersenDecommitment)(nil),\n\t\t(*Message_SchnorrProofData)(nil),\n\t\t(*Message_SchnorrProofRandomData)(nil),\n\t\t(*Message_SchnorrEcProofRandomData)(nil),\n\t\t(*Message_PseudonymsysCaCertificate)(nil),\n\t\t(*Message_PseudonymsysNymGenProofRandomData)(nil),\n\t\t(*Message_PseudonymsysIssueProofRandomData)(nil),\n\t\t(*Message_DoubleBigint)(nil),\n\t\t(*Message_PseudonymsysTransferCredentialData)(nil),\n\t\t(*Message_PseudonymsysCaCertificateEc)(nil),\n\t\t(*Message_PseudonymsysNymGenProofRandomDataEc)(nil),\n\t\t(*Message_PseudonymsysIssueProofRandomDataEc)(nil),\n\t\t(*Message_PseudonymsysTransferCredentialDataEc)(nil),\n\t\t(*Message_SessionKey)(nil),\n\t}\n}",
"func (*Wrapper) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Wrapper_OneofMarshaler, _Wrapper_OneofUnmarshaler, _Wrapper_OneofSizer, []interface{}{\n\t\t(*Wrapper_Source)(nil),\n\t\t(*Wrapper_GherkinDocument)(nil),\n\t\t(*Wrapper_Pickle)(nil),\n\t\t(*Wrapper_Attachment)(nil),\n\t\t(*Wrapper_TestCaseStarted)(nil),\n\t\t(*Wrapper_TestStepStarted)(nil),\n\t\t(*Wrapper_TestStepFinished)(nil),\n\t\t(*Wrapper_TestCaseFinished)(nil),\n\t\t(*Wrapper_TestHookStarted)(nil),\n\t\t(*Wrapper_TestHookFinished)(nil),\n\t}\n}",
"func (*StateRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _StateRequest_OneofMarshaler, _StateRequest_OneofUnmarshaler, _StateRequest_OneofSizer, []interface{}{\n\t\t(*StateRequest_Get)(nil),\n\t\t(*StateRequest_Append)(nil),\n\t\t(*StateRequest_Clear)(nil),\n\t}\n}",
"func (*StateRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _StateRequest_OneofMarshaler, _StateRequest_OneofUnmarshaler, _StateRequest_OneofSizer, []interface{}{\n\t\t(*StateRequest_Get)(nil),\n\t\t(*StateRequest_Append)(nil),\n\t\t(*StateRequest_Clear)(nil),\n\t}\n}",
"func (*Event) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Event_OneofMarshaler, _Event_OneofUnmarshaler, _Event_OneofSizer, []interface{}{\n\t\t(*Event_ResourceHeader)(nil),\n\t\t(*Event_CertAuthority)(nil),\n\t\t(*Event_StaticTokens)(nil),\n\t\t(*Event_ProvisionToken)(nil),\n\t\t(*Event_ClusterName)(nil),\n\t\t(*Event_ClusterConfig)(nil),\n\t\t(*Event_User)(nil),\n\t\t(*Event_Role)(nil),\n\t\t(*Event_Namespace)(nil),\n\t\t(*Event_Server)(nil),\n\t\t(*Event_ReverseTunnel)(nil),\n\t\t(*Event_TunnelConnection)(nil),\n\t\t(*Event_AccessRequest)(nil),\n\t}\n}",
"func (*NetworkAddress) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _NetworkAddress_OneofMarshaler, _NetworkAddress_OneofUnmarshaler, _NetworkAddress_OneofSizer, []interface{}{\n\t\t(*NetworkAddress_Ipv4Address)(nil),\n\t\t(*NetworkAddress_Ipv6Address)(nil),\n\t\t(*NetworkAddress_LocalAddress)(nil),\n\t}\n}",
"func (*NetworkAddress) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _NetworkAddress_OneofMarshaler, _NetworkAddress_OneofUnmarshaler, _NetworkAddress_OneofSizer, []interface{}{\n\t\t(*NetworkAddress_Ipv4Address)(nil),\n\t\t(*NetworkAddress_Ipv6Address)(nil),\n\t\t(*NetworkAddress_LocalAddress)(nil),\n\t}\n}",
"func (*RPC) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _RPC_OneofMarshaler, _RPC_OneofUnmarshaler, _RPC_OneofSizer, []interface{}{\n\t\t(*RPC_Args)(nil),\n\t\t(*RPC_ByteArgs)(nil),\n\t}\n}",
"func (*FeeUpdateRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _FeeUpdateRequest_OneofMarshaler, _FeeUpdateRequest_OneofUnmarshaler, _FeeUpdateRequest_OneofSizer, []interface{}{\n\t\t(*FeeUpdateRequest_Global)(nil),\n\t\t(*FeeUpdateRequest_ChanPoint)(nil),\n\t}\n}",
"func (*FeeUpdateRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _FeeUpdateRequest_OneofMarshaler, _FeeUpdateRequest_OneofUnmarshaler, _FeeUpdateRequest_OneofSizer, []interface{}{\n\t\t(*FeeUpdateRequest_Global)(nil),\n\t\t(*FeeUpdateRequest_ChanPoint)(nil),\n\t}\n}",
"func (*ServiceSpec) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _ServiceSpec_OneofMarshaler, _ServiceSpec_OneofUnmarshaler, _ServiceSpec_OneofSizer, []interface{}{\n\t\t(*ServiceSpec_Replicated)(nil),\n\t\t(*ServiceSpec_Global)(nil),\n\t}\n}",
"func (*ServiceSpec) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _ServiceSpec_OneofMarshaler, _ServiceSpec_OneofUnmarshaler, _ServiceSpec_OneofSizer, []interface{}{\n\t\t(*ServiceSpec_Replicated)(nil),\n\t\t(*ServiceSpec_Global)(nil),\n\t}\n}",
"func (*ServiceSpec) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _ServiceSpec_OneofMarshaler, _ServiceSpec_OneofUnmarshaler, _ServiceSpec_OneofSizer, []interface{}{\n\t\t(*ServiceSpec_Replicated)(nil),\n\t\t(*ServiceSpec_Global)(nil),\n\t}\n}",
"func (*TestUTF8) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _TestUTF8_OneofMarshaler, _TestUTF8_OneofUnmarshaler, _TestUTF8_OneofSizer, []interface{}{\n\t\t(*TestUTF8_Field)(nil),\n\t}\n}",
"func (*TestUTF8) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _TestUTF8_OneofMarshaler, _TestUTF8_OneofUnmarshaler, _TestUTF8_OneofSizer, []interface{}{\n\t\t(*TestUTF8_Field)(nil),\n\t}\n}",
"func (*Eos) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Eos_OneofMarshaler, _Eos_OneofUnmarshaler, _Eos_OneofSizer, []interface{}{\n\t\t(*Eos_GrpcStatusCode)(nil),\n\t\t(*Eos_ResetErrorCode)(nil),\n\t}\n}",
"func (*Eos) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Eos_OneofMarshaler, _Eos_OneofUnmarshaler, _Eos_OneofSizer, []interface{}{\n\t\t(*Eos_GrpcStatusCode)(nil),\n\t\t(*Eos_ResetErrorCode)(nil),\n\t}\n}",
"func (*RecordKey) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _RecordKey_OneofMarshaler, _RecordKey_OneofUnmarshaler, _RecordKey_OneofSizer, []interface{}{\n\t\t(*RecordKey_DatastoreKey)(nil),\n\t\t(*RecordKey_BigQueryKey)(nil),\n\t}\n}",
"func (*WatchRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _WatchRequest_OneofMarshaler, _WatchRequest_OneofUnmarshaler, _WatchRequest_OneofSizer, []interface{}{\n\t\t(*WatchRequest_CreateRequest)(nil),\n\t\t(*WatchRequest_CancelRequest)(nil),\n\t}\n}",
"func (*Node) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Node_OneofMarshaler, _Node_OneofUnmarshaler, _Node_OneofSizer, []interface{}{\n\t\t(*Node_Src)(nil),\n\t\t(*Node_Snk)(nil),\n\t\t(*Node_ContentHash)(nil),\n\t}\n}",
"func (*FeedMapping) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _FeedMapping_OneofMarshaler, _FeedMapping_OneofUnmarshaler, _FeedMapping_OneofSizer, []interface{}{\n\t\t(*FeedMapping_PlaceholderType)(nil),\n\t\t(*FeedMapping_CriterionType)(nil),\n\t}\n}",
"func (*Virtual) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Virtual_OneofMarshaler, _Virtual_OneofUnmarshaler, _Virtual_OneofSizer, []interface{}{\n\t\t(*Virtual_Genesis)(nil),\n\t\t(*Virtual_Child)(nil),\n\t\t(*Virtual_Jet)(nil),\n\t\t(*Virtual_IncomingRequest)(nil),\n\t\t(*Virtual_OutgoingRequest)(nil),\n\t\t(*Virtual_Result)(nil),\n\t\t(*Virtual_Type)(nil),\n\t\t(*Virtual_Code)(nil),\n\t\t(*Virtual_Activate)(nil),\n\t\t(*Virtual_Amend)(nil),\n\t\t(*Virtual_Deactivate)(nil),\n\t\t(*Virtual_PendingFilament)(nil),\n\t}\n}",
"func (*CloseStatusUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _CloseStatusUpdate_OneofMarshaler, _CloseStatusUpdate_OneofUnmarshaler, _CloseStatusUpdate_OneofSizer, []interface{}{\n\t\t(*CloseStatusUpdate_ClosePending)(nil),\n\t\t(*CloseStatusUpdate_Confirmation)(nil),\n\t\t(*CloseStatusUpdate_ChanClose)(nil),\n\t}\n}",
"func (*CloseStatusUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _CloseStatusUpdate_OneofMarshaler, _CloseStatusUpdate_OneofUnmarshaler, _CloseStatusUpdate_OneofSizer, []interface{}{\n\t\t(*CloseStatusUpdate_ClosePending)(nil),\n\t\t(*CloseStatusUpdate_Confirmation)(nil),\n\t\t(*CloseStatusUpdate_ChanClose)(nil),\n\t}\n}",
"func (*CloseStatusUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _CloseStatusUpdate_OneofMarshaler, _CloseStatusUpdate_OneofUnmarshaler, _CloseStatusUpdate_OneofSizer, []interface{}{\n\t\t(*CloseStatusUpdate_ClosePending)(nil),\n\t\t(*CloseStatusUpdate_Confirmation)(nil),\n\t\t(*CloseStatusUpdate_ChanClose)(nil),\n\t}\n}",
"func (*CloseStatusUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _CloseStatusUpdate_OneofMarshaler, _CloseStatusUpdate_OneofUnmarshaler, _CloseStatusUpdate_OneofSizer, []interface{}{\n\t\t(*CloseStatusUpdate_ClosePending)(nil),\n\t\t(*CloseStatusUpdate_Confirmation)(nil),\n\t\t(*CloseStatusUpdate_ChanClose)(nil),\n\t}\n}",
"func (*CloseStatusUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _CloseStatusUpdate_OneofMarshaler, _CloseStatusUpdate_OneofUnmarshaler, _CloseStatusUpdate_OneofSizer, []interface{}{\n\t\t(*CloseStatusUpdate_ClosePending)(nil),\n\t\t(*CloseStatusUpdate_ChanClose)(nil),\n\t}\n}",
"func (*CloseStatusUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _CloseStatusUpdate_OneofMarshaler, _CloseStatusUpdate_OneofUnmarshaler, _CloseStatusUpdate_OneofSizer, []interface{}{\n\t\t(*CloseStatusUpdate_ClosePending)(nil),\n\t\t(*CloseStatusUpdate_ChanClose)(nil),\n\t}\n}",
"func (*CloseStatusUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _CloseStatusUpdate_OneofMarshaler, _CloseStatusUpdate_OneofUnmarshaler, _CloseStatusUpdate_OneofSizer, []interface{}{\n\t\t(*CloseStatusUpdate_ClosePending)(nil),\n\t\t(*CloseStatusUpdate_ChanClose)(nil),\n\t}\n}",
"func (*PrintKVRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _PrintKVRequest_OneofMarshaler, _PrintKVRequest_OneofUnmarshaler, _PrintKVRequest_OneofSizer, []interface{}{\n\t\t(*PrintKVRequest_ValueString)(nil),\n\t\t(*PrintKVRequest_ValueInt)(nil),\n\t}\n}",
"func (*Identity) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Identity_OneofMarshaler, _Identity_OneofUnmarshaler, _Identity_OneofSizer, []interface{}{\n\t\t(*Identity_ServiceAccount)(nil),\n\t\t(*Identity_Hostname)(nil),\n\t}\n}",
"func (*ChannelEventUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _ChannelEventUpdate_OneofMarshaler, _ChannelEventUpdate_OneofUnmarshaler, _ChannelEventUpdate_OneofSizer, []interface{}{\n\t\t(*ChannelEventUpdate_OpenChannel)(nil),\n\t\t(*ChannelEventUpdate_ClosedChannel)(nil),\n\t\t(*ChannelEventUpdate_ActiveChannel)(nil),\n\t\t(*ChannelEventUpdate_InactiveChannel)(nil),\n\t}\n}",
"func (*ChannelEventUpdate) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _ChannelEventUpdate_OneofMarshaler, _ChannelEventUpdate_OneofUnmarshaler, _ChannelEventUpdate_OneofSizer, []interface{}{\n\t\t(*ChannelEventUpdate_OpenChannel)(nil),\n\t\t(*ChannelEventUpdate_ClosedChannel)(nil),\n\t\t(*ChannelEventUpdate_ActiveChannel)(nil),\n\t\t(*ChannelEventUpdate_InactiveChannel)(nil),\n\t}\n}"
] | [
"0.8907044",
"0.8906012",
"0.88909197",
"0.8869721",
"0.8868361",
"0.88635784",
"0.886303",
"0.8862766",
"0.8862009",
"0.88613117",
"0.88597536",
"0.8855407",
"0.8853634",
"0.8852364",
"0.8852364",
"0.8852364",
"0.88475925",
"0.8846927",
"0.8845165",
"0.8844588",
"0.88421",
"0.88373846",
"0.8836481",
"0.8836481",
"0.8836481",
"0.8836481",
"0.88350636",
"0.88350636",
"0.88350636",
"0.88350636",
"0.88350636",
"0.88350636",
"0.8833803",
"0.8830951",
"0.8830927",
"0.88306624",
"0.8830648",
"0.88286823",
"0.8828507",
"0.8827149",
"0.88245004",
"0.88238555",
"0.882339",
"0.88216823",
"0.88189507",
"0.88189507",
"0.88189507",
"0.88189507",
"0.88147074",
"0.88129985",
"0.8811185",
"0.8810595",
"0.8810595",
"0.8808957",
"0.88082725",
"0.8807316",
"0.8807316",
"0.8806336",
"0.8806336",
"0.8806336",
"0.8806229",
"0.88047534",
"0.8804656",
"0.8803744",
"0.8803411",
"0.88032824",
"0.8801895",
"0.8801722",
"0.87994444",
"0.8799279",
"0.8796938",
"0.8796938",
"0.8795593",
"0.87951773",
"0.87951773",
"0.87925434",
"0.8791623",
"0.8791623",
"0.8791062",
"0.8791062",
"0.8791062",
"0.8789731",
"0.8789731",
"0.87887543",
"0.87887543",
"0.87883765",
"0.87882817",
"0.8786649",
"0.8786411",
"0.8785757",
"0.87851715",
"0.87851715",
"0.87851715",
"0.87851715",
"0.8785038",
"0.8785038",
"0.8785038",
"0.87844294",
"0.87825185",
"0.8782428",
"0.8782428"
] | 0.0 | -1 |
init initialises player's state | func (player *musicPlayer) init(playlistDir string) error {
player.Lock()
defer player.Unlock()
player.state = new(state)
player.state.status = waiting
player.state.current = 0
player.state.queue = make([]string, 0)
player.playlistsDir = playlistDir
return nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (s *Spyfall) Init(id, code string) {\n\ts.Id = id\n\ts.Code = code\n\ts.cmds = make(chan *lib.PlayerCmd)\n\ts.Players = []*Player{}\n\n\ts.timer = time.NewTimer(1 * time.Minute)\n\tif !s.timer.Stop() {\n\t\t<-s.timer.C\n\t}\n\tlog.Println(\"New game initialized\", s)\n\t// TODO: save to mongo\n}",
"func (p *Player) InitPlayer(pName string) {\n\n\tid := uuid.New()\n\tp.PlayerID = id.String()\n\tp.Name = pName\n\tp.PlayerMatrix.InitMatrix()\n\tp.BingoLines = 0\n}",
"func (room *GameRoom) init() {\n\tif room.whiteList == nil {\n\t\troom.whiteList = make(map[string]*User)\n\t\troom.blackList = make(map[string]*User)\n\t\troom.inEffectCard = []*Card{}\n\t\troom.turnPlayers = []*User{}\n\t\troom.Turn = 0\n\t\troom.Clock = 11\n\t\troom.IsRouletteTurn = true\n\t\troom.IsRouletteTurn = false\n\t\troom.Level = 1\n\t}\n}",
"func init() {\n\tplayer1 = &chessPlayer{\"Garry Kasparov\", \"White\", []piece{}}\n\tplayer2 = &chessPlayer{\"Deep Blue\", \"Black\", []piece{}}\n\tsessionPlayers = append(sessionPlayers, player1, player2)\n}",
"func (s *Speaker) Init() error { return nil }",
"func (m *Mixtape) init() {\n\tm.Users = []User{}\n\tm.Playlists = []Playlist{}\n\tm.Songs = []Song{}\n}",
"func (b *Backend) init() {\n\tif b.state == \"\" {\n\t\tb.state = IDLE\n\t}\n}",
"func (a *acceptor) init() error {\n\tinstanceID, err := a.state.load()\n\tif err != nil {\n\t\tlNLErr(\"Load State fail, error: %v\", err)\n\t\treturn err\n\t}\n\n\tif instanceID == 0 {\n\t\tlPLGImp(a.conf.groupIdx, \"Empty database\")\n\t}\n\n\ta.setInstanceID(instanceID)\n\n\tlPLGImp(a.conf.groupIdx, \"OK\")\n\n\treturn nil\n}",
"func (l *Loader) init() {\n\tif l.loading == nil {\n\t\tl.loading = stringset.New(1)\n\t\tl.sources = make(map[string]string, 1)\n\t\tl.symbols = make(map[string]*Struct, 1)\n\t}\n}",
"func makePlayer() {\n\tP = Player{name: \"Abraxas\", level: 1, health: 30, maxHealth: 30, defense: 4, attack: 11}\n}",
"func (s *GameSettingsScene) initialize(state *GameState) {\n\ts.backButton = NewBackButton(\n\t\tstate.sceneManager.previous,\n\t\tfunc() (int, int) { width, height := Resolution(); return width * 9 / 10, height * 9 / 10 })\n\n\ts.currentElement = 0\n\ts.previousElement = 1 // Set this to 1 so that there is no conflict with currentElement\n\ts.tempSettings = createTempSettings(GameSettings)\n\ts.saveButton = NewSaveSettingsButton(func() (int, int) { width, height := Resolution(); return width * 1 / 10, height * 9 / 10 })\n\n\ts.initialized = true\n}",
"func (g *Game) initPlayers(names []string) {\n\tg.addMessage(\"Initializing players...\")\n\n\tg.Players = make([]*Player, len(names))\n\n\tfor i, name := range names {\n\t\tid, err := uuid.GenUUID()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tp := &Player{\n\t\t\tID: id,\n\t\t\tName: name,\n\t\t\tFactories: make([]Factory, 1),\n\t\t\tMoney: 12,\n\t\t\tChatMessages: Queue{Capacity: 500},\n\t\t\tTurnOrder: i}\n\n\t\tp.Factories[0] = Factory{Key: \"p1\", Capacity: 1}\n\n\t\tg.Players[i] = p\n\t}\n\n\tp := g.Players[0]\n\tp.IsCurrent = true\n}",
"func init() {\n\t// Initialization goes here\n}",
"func gameInit(ass assets) int {\n\n\t// Set global speed\n\tglobalSpeed = 1.5\n\n\t// Initialize background\n\tbg.init(ass)\n\n\t// Init hud\n\thud.init(ass)\n\n\t// Init game objects\n\tgobj.init(ass)\n\n\t// Init status\n\tinitStatus()\n\n\t// Not paused\n\tpaused = false\n\n\treturn 0\n}",
"func (m *Mob) Init(s *Sprite, x float64, y float64) {\n\tm.Graphics = Graphics{\n\t\tsprite: s.Frame,\n\t\tbatch: global.gTextures.batch,\n\t}\n\tm.Bounds = &Bounds{\n\t\tX: x,\n\t\tY: y,\n\t\tWidth: s.Width,\n\t\tHeight: s.Height,\n\t\tentity: m,\n\t}\n}",
"func init() {\n\t//todo...\n}",
"func init() {\n\n\truntime.LockOSThread()\n\n\t// Video only\n\tif err := sdl.Init(sdl.INIT_VIDEO); err != nil {\n\t\tlogger.Warning(err.Error())\n\t}\n}",
"func (this *ClientHolder) init() {\n\tthis.holder = make([]*ChatClient, 0)\n\tthis.lock = new(sync.RWMutex)\n\n}",
"func (m *MixtapeIndex) init() {\n\tm.Users = make(map[string]*User)\n\tm.Playlists = make(map[string]*Playlist)\n\tm.Songs = make(map[string]*Song)\n\tm.PlaylistIdUpperBound = -1\n}",
"func (cc *Game) Init(stub shim.ChaincodeStubInterface) peer.Response {\n\treturn shim.Success(nil)\n}",
"func (e *Engine) init() {\n\n\te.mutex.Lock()\n\tdefer e.mutex.Unlock()\n\n\tif e.ctx == nil || e.cancel == nil {\n\t\te.ctx, e.cancel = context.WithCancel(e.parent)\n\t}\n\n\tif e.timeout == 0 {\n\t\te.timeout = DefaultTimeout\n\t}\n\n\tif len(e.signals) == 0 && !e.noSignal {\n\t\te.signals = Signals\n\t}\n\n\tif e.interrupt == nil {\n\t\te.interrupt = make(chan os.Signal, 1)\n\t}\n\n}",
"func PlayerConstructor(L *lua.LState) int {\n\t// Retrieve player\n\tv := L.Get(1)\n\tvar player *models.Player\n\tvar err error\n\n\tif v.Type() == lua.LTNumber {\n\t\tplayer, err = playerTableConstructor(L.ToInt64(1))\n\t}\n\n\tif v.Type() == lua.LTString {\n\t\tplayer, err = playerTableConstructor(L.ToString(1))\n\t}\n\n\tif err != nil {\n\t\tL.Push(lua.LNil)\n\t\treturn 1\n\t}\n\n\tL.Push(createPlayerMetaTable(player, L))\n\treturn 1\n}",
"func (l *Logger) init() {\r\n\t// Set Testing flag to TRUE if testing detected\r\n\tl.Options.Testing = (flag.Lookup(\"test.v\") != nil)\r\n\r\n\tl.timeReset()\r\n\tl.started = l.timer\r\n\tinitColors()\r\n\tinitFormatPlaceholders()\r\n}",
"func init() {}",
"func init() {}",
"func init() {}",
"func init() {}",
"func (tx *TextureBase) Init(sc *Scene) error {\n\tif tx.Tex != nil {\n\t\ttx.Tex.SetBotZero(tx.Bot0)\n\t\ttx.Tex.Activate(0)\n\t}\n\treturn nil\n}",
"func init() {\n\t// init func\n}",
"func (c *Credits) Init() {\n\tc.nextStateID = \"credits\"\n\tc.alfa = 0\n\tc.state = enter\n\tc.uicredits.Reset()\n}",
"func (ui *UI) Init() {\n\tui.Palettes = make(map[int]*Palette)\n\tui.Palettes[0] = GetUIPalette()\n\tui.Palettes[1] = GetProjectMegaPalette(\"assets/sprites/projectmute.png\")\n\tui.Palettes[2] = GetProjectMegaPalette(\"assets/sprites/projectmuteG.png\")\n\tui.Palettes[3] = GetProjectMegaPalette(\"assets/sprites/projectmuteY.png\")\n\tui.Palettes[4] = GetProjectMegaPalette(\"assets/sprites/projectmuteR.png\")\n\n\tui.SoundConfirm = rl.LoadSound(\"assets/sounds/confirm.mp3\")\n\tui.SoundSelect = rl.LoadSound(\"assets/sounds/select.mp3\")\n\tui.SoundCancel = rl.LoadSound(\"assets/sounds/cancel.mp3\")\n\tui.Toggles = make(map[string]bool)\n\tui.BuildingCache = &Building{}\n}",
"func (s *DiscordState) Init() error {\n\ts.Session = new(discordgo.Session)\n\t\n\tfmt.Printf(\"\\nConnecting…\")\n\n\tdg, err := discordgo.New(Config.Username, Config.Password)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Open the websocket and begin listening.\n\tdg.Open()\n\n\t//Retrieve GuildID's from current User\n\t//need index of Guilds[] rather than UserGuilds[] (maybe)\n\tGuilds, err := dg.UserGuilds(0, \"\", \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts.Guilds = Guilds\n\n\ts.Session = dg\n\n\ts.User, _ = s.Session.User(\"@me\")\n\n\tfmt.Printf(\" PASSED!\\n\")\n\n\treturn nil\n}",
"func newPlayer(c *websocket.Conn, id uint) *player {\n\tp := new(player)\n\tp.connection = c\n\tp.id = id\n\tp.location = &playerXY{default_x, default_y}\n\tp.velocity = &playerXY{0, 0}\n\tp.health = default_health\n\tp.currentAction = action_stop\n\tp.startedMoving = 0\n\treturn p\n}",
"func (C *character) Init(name string, class string, lvl int, xpac int, needxp int, maxlife int, life int, manamax int, mana int, initiative int, damage int, money int, slotinv int, inventory []string, skill []string, head string, body string, foot string, hand string) {\n\tC.name = name\n\tC.class = class\n\tC.lvl = lvl\n\tC.xpac = xpac\n\tC.needxp = needxp\n\tC.maxlife = maxlife\n\tC.life = life\n\tC.manamax = manamax\n\tC.mana = mana\n\tC.initiative = initiative\n\tC.slotinv = slotinv\n\tC.inventory = inventory\n\tC.money = money\n\tC.skill = skill\n\tC.equip.head = head\n\tC.equip.body = body\n\tC.equip.foot = foot\n\tC.equip.hand = hand\n}",
"func (m *Manager) init(ledgerIndex iotago.MilestoneIndex) error {\n\tm.currentLock.Lock()\n\tdefer m.currentLock.Unlock()\n\n\tcurrentProtoParams, err := m.storage.ProtocolParameters(ledgerIndex)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tm.current = currentProtoParams\n\tm.loadPending(ledgerIndex)\n\n\treturn nil\n}",
"func (c *cState) init(bw *bitWriter, ct *cTable, first symbolTransform) {\n\tc.bw = bw\n\tc.stateTable = ct.stateTable\n\tif len(c.stateTable) == 1 {\n\t\t// RLE\n\t\tc.stateTable[0] = uint16(0)\n\t\tc.state = 0\n\t\treturn\n\t}\n\tnbBitsOut := (first.deltaNbBits + (1 << 15)) >> 16\n\tim := int32((nbBitsOut << 16) - first.deltaNbBits)\n\tlu := (im >> nbBitsOut) + int32(first.deltaFindState)\n\tc.state = c.stateTable[lu]\n}",
"func (e *EventSourcedEntity) init() error {\n\te.SnapshotEvery = snapshotEveryDefault\n\treturn nil\n}",
"func (or *orchestrator) init() {\n\tor.sigStop = make(chan struct{})\n\tor.blkCache = ring.New(orBlockCacheCapacity)\n\n\t// connect services' input channels to their source\n\tor.mgr.trd.inTransaction = or.mgr.bld.outTransaction\n\tor.mgr.acd.inAccount = or.mgr.trd.outAccount\n\tor.mgr.lgd.inLog = or.mgr.trd.outLog\n\tor.mgr.bld.inBlock = or.mgr.bls.outBlock\n\tor.mgr.bls.inDispatched = or.mgr.bld.outDispatched\n\tor.mgr.bud.inTransaction = or.mgr.trd.outTransaction\n\tor.inScanStateSwitch = or.mgr.bls.outStateSwitch\n\n\t// read initial block scanner state\n\t// no need to worry about race condition, init() is called sequentially and this is the last one\n\tor.pushHeads = or.mgr.bls.onIdle\n}",
"func init() {\n\tif err := sdl.InitSubSystem(sdl.INIT_JOYSTICK | sdl.INIT_GAMECONTROLLER); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor i := 0; i < sdl.NumJoysticks(); i++ {\n\t\taddJoystick(i)\n\t}\n\n\tsdl.JoystickEventState(sdl.ENABLE)\n\tsdl.GameControllerEventState(sdl.ENABLE)\n}",
"func (m *Mob) Initialize() {\n\tm.CurrentHP = m.MaxHP\n\n\t// initialize position data\n\tm.position = &context.Position{\n\t\tInitialX: int(m.SpawnX),\n\t\tInitialY: int(m.SpawnY),\n\t\tCurrentX: int(m.SpawnX),\n\t\tCurrentY: int(m.SpawnY),\n\t\tFinalX: int(m.SpawnX),\n\t\tFinalY: int(m.SpawnY),\n\t}\n\n\tm.SetState(MobStateFind)\n}",
"func (s *Settings) Initialize(state *pb.GameState) error {\n\tstate.PointsState = &pb.PointsState{\n\t\tUsa: &pb.PointStoresState{\n\t\t\tPolitical: &pb.PointStoreState{\n\t\t\t\tCount: s.Usa.Political.Init,\n\t\t\t},\n\t\t\tMilitary: &pb.PointStoreState{\n\t\t\t\tCount: s.Usa.Military.Init,\n\t\t\t},\n\t\t\tCovert: &pb.PointStoreState{\n\t\t\t\tCount: s.Usa.Covert.Init,\n\t\t\t},\n\t\t},\n\t\tUssr: &pb.PointStoresState{\n\t\t\tPolitical: &pb.PointStoreState{\n\t\t\t\tCount: s.Ussr.Political.Init,\n\t\t\t},\n\t\t\tMilitary: &pb.PointStoreState{\n\t\t\t\tCount: s.Ussr.Military.Init,\n\t\t\t},\n\t\t\tCovert: &pb.PointStoreState{\n\t\t\t\tCount: s.Ussr.Covert.Init,\n\t\t\t},\n\t\t},\n\t}\n\treturn nil\n}",
"func (s *fseState) init(br *bitReader, tableLog uint8, dt []decSymbol) {\n\ts.dt = dt\n\tbr.fill()\n\ts.state = dt[br.getBits(tableLog)]\n}",
"func (g *GameState) Start() {\n\tprintln(\"Game State Initialized\")\n\t// seconds := time.Duration(1000 / 30)\n\t// // ticker := time.Tick(seconds * time.Millisecond)\n\n}",
"func init() {\n\tgo chatroom()\n}",
"func (g *Game) Init() {\n\n\t// Set gameReference\n\tgameReference = g\n\n\t// Init lightHandler\n\tg.lightHandler = initLightHandler()\n\tplayerLightID := g.lightHandler.addLight(g.lightHandler.lightImages.playerLight, 0)\n\n\t// Init maps\n\tinitMaps(g)\n\n\t// Player\n\tg.player = createPlayer(\n\t\tnewVec2f(screenWidth/2, screenHeight/2),\n\t\tg,\n\t\tplayerLightID,\n\t)\n\tg.shadows = append(g.shadows, &g.player.shadow)\n\n\t// Test items! ============================\n\t// TODO: REMOVE THIS v\n\ttestItem := createItem(\n\t\tnewVec2f(300, 100), // Position\n\t\tiitemsSpritesheet, // Image\n\t)\n\ttestItem.init()\n\tg.items = append(g.items, testItem)\n\ttestItem = createItem(\n\t\tnewVec2f(200, 100), // Position\n\t\tiitemsSpritesheet, // Image\n\t)\n\ttestItem.init()\n\tg.items = append(g.items, testItem)\n\ttestItem = createItem(\n\t\tnewVec2f(100, 100), // Position\n\t\tiitemsSpritesheet, // Image\n\t)\n\ttestItem.init()\n\tg.items = append(g.items, testItem)\n\t// TODO: REMOVE THIS ^\n\t// Test items! ============================\n\n\t// Cursor\n\tg.cursor = createCursor(iUISpritesheet)\n\n\t// Background image\n\ttestBackgroundImage, _ = loadImage(\"./Assets/Art/background.png\")\n\n\t// Fonts\n\tg.InitFonts()\n\n\t// Generate starting walls\n\tg.walls = generateWalls(itileSpritesheet)\n\tg.tiles = generateTiles(itileSpritesheet)\n\tgenerateBigTiles(g.tiles, itileSpritesheet)\n\tg.borders = generateBorders(itileSpritesheet)\n\tg.ui = generateUI(iUISpritesheet)\n\n\t// Init lua functions\n\tL := lua.NewState()\n\tdefer L.Close()\n\tinitLuaFunctions(L)\n\n\t// Make the astar path channel\n\tastarChannel = make(chan *paths.Path, 500)\n\n\t// State starts in game [temporary]\n\tg.state = 1\n\n\t// Init music\n\tloadMusic()\n\t// Play song\n\t//go music[rand.Intn(len(music)-1)].play()\n\n\t// GAME SETTINGS\n\tloadSettings(&g.settings)\n\n\tif g.settings.Graphics.Fullscreen { // Enable fullscreen if enabled\n\t\tebiten.SetFullscreen(true)\n\t}\n\n\t// Enemy spawners\n\tg.enemySpawners = append(g.enemySpawners, createEnemySpawner(g.currentMap.randomPosition(), EBeefEye, float64(rand.Intn(600)+60), image.Rect(31, 50, 59, 71)))\n\tg.enemySpawners = append(g.enemySpawners, createEnemySpawner(g.currentMap.randomPosition(), EWorm, float64(rand.Intn(300)+50), image.Rect(0, 0, 17, 22)))\n\n}",
"func (c *Client) init() {\n\tc.headers = make(chan *types.Header)\n\tc.blocks = make(chan *types.Block)\n\tc.transactions = make(chan *interfaces.TxWithBlock)\n\n\tc.shutdown = make(chan struct{})\n\tc.loopExit = make(chan struct{})\n\tc.errs = make(chan error, 1)\n\tc.sendErrorOnce = new(sync.Once)\n}",
"func (a *amplifier) init(program, input []int) {\n\ta.state = make([]int, len(program))\n\tcopy(a.state, program)\n\ta.input = input\n}",
"func initLocalStateManager() {\n\tboard = *models.InitialBoard()\n\n\tgraphics.InitBoardImage()\n\tgo boardLoop()\n\n\tebiten.Run(update, graphics.TotalWidth, graphics.TotalHeight, 2, \"Lightriders!\")\n}",
"func (s Players) Init() (out Players) {\n\tslicecopy := append([]Player(nil), s...)\n\treturn slicecopy[:len(s)-1]\n}",
"func (es *eeStack) init(caps int) {\r\n\t((*eeValues)(es)).init(caps)\r\n}",
"func (p *PRPlugin) init() {\n\tp.Logger = log.NewFor(p.Name)\n\tp.Debug(\"plugin initialized\")\n}",
"func init() {\n\t// This function will be executed before everything else.\n\t// Do some initialization here.\n\tSBC = data.NewBlockChain()\n\t// When server works\n\t// Peers = data.NewPeerList(Register(), 32)\n\t// While server doesn't work -> use port as id\n\tid, _ := strconv.ParseInt(os.Args[1], 10, 64)\n\tPeers = data.NewPeerList(int32(id), 32)\n\tifStarted = true\n}",
"func init() {\n\tinstance = GetInstance()\n}",
"func (d *decoder) init(in *bitReader, dt []decSymbol, tableLog uint8) {\n\td.dt = dt\n\td.br = in\n\td.state = in.getBits(tableLog)\n}",
"func newPlayer(seat int, shoe *Shoe, cfg *Config, strategy Strategy, betAmount int) *Player {\n\tvar p Player\n\t// fmt.Println(\"in newPlayer\")\n\tp.seat = seat\n\tp.shoe = shoe\n\tp.cfg = cfg\n\tp.strategy = strategy\n\tp.betAmount = betAmount\n\treturn &p\n}",
"func (howtoplay *howtoplay) Initialize() {\n\tsimra.LogDebug(\"[IN]\")\n\n\tsimra.GetInstance().SetDesiredScreenSize(config.ScreenWidth, config.ScreenHeight)\n\n\t// initialize sprites\n\thowtoplay.initialize()\n\n\tsimra.LogDebug(\"[OUT]\")\n}",
"func (s *Solo) Init(state *state.State, service *service.Service) error {\n\n\ts.logger.Debug(\"INIT\")\n\n\ts.state = state\n\ts.service = service\n\n\treturn nil\n}",
"func (o *Note) Init() {\n\to.diff = o.State().(noteDiff)\n}",
"func init() {\n\t\n\t\t// note:\n\t\t// Each time you set the same seed, you get the same sequence\n\t\t// You have to set the seed only once\n\t\t// you simply call Intn to get the next random integer\n\t\trand.Seed(time.Now().UTC().UnixNano())\n\t}",
"func newPlayer(s sender, tape tape, pm core.PulseManager, scheme core.PlatformCryptographyScheme) *player {\n\treturn &player{sender: s, tape: tape, pm: pm, scheme: scheme}\n}",
"func (p *scopeParser) init() {\n\tp.currentScope = nil\n\tp.fileScope = &FileScope{\n\t\tVariableMap: make(map[*tree.Token]*Variable, 4),\n\t\tScopeMap: make(map[tree.Node]*Scope, 4),\n\t}\n}",
"func (shuffle *Action) Initialize() {}",
"func init() {\n\tevent = &pubSubEvent{ctx: context.Background()}\n\tevent.initClientAndTopic()\n}",
"func init() {\n\tactions = make(map[string]InitFunc)\n}",
"func init() {\n\tMoods = map[string]MoodState{\n\t\t\"cloudNine\": MoodStateOnCloudNine,\n\t\t\"happy\": MoodStateHappy,\n\t\t\"bored\": MoodStateAngry,\n\t}\n}",
"func (u *Uploader) init() {\n\t// generate mac and upload token\n\tputPolicy := storage.PutPolicy{\n\t\tScope: u.bucket,\n\t}\n\tmac := qbox.NewMac(u.accessKey, u.secretKey)\n\tu.upToken = putPolicy.UploadToken(mac)\n\n\tcfg := storage.Config{}\n\t// 空间对应的机房\n\tcfg.Zone = &storage.ZoneHuadong\n\t// 是否使用https域名\n\tcfg.UseHTTPS = false\n\t// 上传是否使用CDN上传加速\n\tcfg.UseCdnDomains = false\n\t// 构建表单上传的对象\n\tu.formUploader = storage.NewFormUploader(&cfg)\n\tu.bucketManager = storage.NewBucketManager(mac, &cfg)\n\n\treturn\n}",
"func (g *Game) Init(setting interface{}) bool {\n\tg.Log.Debug(\"Init: initialization start\\n\")\n\treturn g.OnInit(setting)\n}",
"func (c *ChromaHighlight) init() (err error) {\n\n\t// Option handling registering formatters\n\tswitch c.formatter {\n\tcase \"gtkDirectToTextBuffer\":\n\t\tformatters.Register(\"gtkDirectToTextBuffer\", chroma.FormatterFunc(c.gtkDirectToTextBufferFormatter))\n\tcase \"gtkTextBuffer\":\n\t\tformatters.Register(\"gtkTextBuffer\", chroma.FormatterFunc(c.gtkTextBufferFormatter))\n\tcase \"pango\":\n\t\tformatters.Register(\"pango\", chroma.FormatterFunc(c.pangoFormatter))\n\t}\n\n\t// Used to parse GdkColor\n\tc.regBG = regexp.MustCompile(`bg:#[a-fA-F|0-9]{6}`)\n\tc.regFG = regexp.MustCompile(`#[a-fA-F|0-9]{6}`)\n\n\tc.RemoveTags()\n\n\t// To check if source text have been modified.\n\tc.md5SizeAnalyze = 1024 // Set to 0 means there is no limit\n\n\tswitch c.srcBuff {\n\tcase nil:\n\t\tc.textTagTable, err = c.txtBuff.GetTagTable()\n\tdefault:\n\t\tc.textTagTable, err = c.srcBuff.GetTagTable()\n\t}\n\treturn\n}",
"func Init() (s Self) {\n\ts.Capitals = readJSON(capitalsEmbed)\n\treturn s\n}",
"func (sr *shadowsocksReader) init() (err error) {\n\tif sr.aead == nil {\n\t\t// For chacha20-poly1305, SaltSize is 32, NonceSize is 12 and Overhead is 16.\n\t\tsalt := make([]byte, sr.ssCipher.SaltSize())\n\t\tif _, err := io.ReadFull(sr.reader, salt); err != nil {\n\t\t\tif err != io.EOF && err != io.ErrUnexpectedEOF {\n\t\t\t\terr = fmt.Errorf(\"failed to read salt: %v\", err)\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\tsr.aead, err = sr.ssCipher.Decrypter(salt)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create AEAD: %v\", err)\n\t\t}\n\t\tsr.counter = make([]byte, sr.aead.NonceSize())\n\t\tsr.buf = make([]byte, payloadSizeMask+sr.aead.Overhead())\n\t}\n\treturn nil\n}",
"func (state *State) Init() {\n\tstate.expr = make(exprState, 64)\n\tstate.lua = lua.NewState()\n}",
"func Init(title string, width, height float32) {\n\tprintln(\"Initializing Gdx\")\n\ttargetWidth = width\n\ttargetHeight = height\n\tallScenes = make(map[string]*Scene)\n\tfpsTicker = time.NewTicker(1000 / 30 * time.Millisecond)\n\trunning = true\n\tinitConfig(title)\n}",
"func (a *GCRLoginAgent) init() {\n\tif a.In == nil {\n\t\ta.In = os.Stdin\n\t}\n\tif a.Out == nil {\n\t\ta.Out = os.Stdout\n\t}\n\tif a.OpenBrowser == nil {\n\t\ta.OpenBrowser = webbrowser.Open\n\t}\n}",
"func (c *cartridge) Init() {\n\tc.counter = 0\n\tc.x = 40\n\tc.y = 0\n\tc.speedY = 2\n}",
"func Init(firstScene string) {\n\tdlog.CreateLogFile()\n\n\tinitConf()\n\n\t// Set variables from conf file\n\tdlog.SetStringDebugLevel(conf.Debug.Level)\n\tdlog.SetDebugFilter(conf.Debug.Filter)\n\n\tdlog.Info(\"Oak Init Start\")\n\n\tScreenWidth = conf.Screen.Width\n\tScreenHeight = conf.Screen.Height\n\tFrameRate = conf.FrameRate\n\tDrawFrameRate = conf.DrawFrameRate\n\tSetLang(conf.Language)\n\n\twd, _ := os.Getwd()\n\n\trender.SetFontDefaults(wd, conf.Assets.AssetPath, conf.Assets.FontPath,\n\t\tconf.Font.Hinting, conf.Font.Color, conf.Font.File, conf.Font.Size,\n\t\tconf.Font.DPI)\n\t// END of loading variables from configuration\n\n\tSeedRNG(DefaultSeed)\n\n\timageDir := filepath.Join(wd,\n\t\tconf.Assets.AssetPath,\n\t\tconf.Assets.ImagePath)\n\taudioDir := filepath.Join(wd,\n\t\tconf.Assets.AssetPath,\n\t\tconf.Assets.AudioPath)\n\n\tdlog.Info(\"Init Scene Loop\")\n\tgo sceneLoop(firstScene)\n\tdlog.Info(\"Init asset load\")\n\tgo loadAssets(imageDir, audioDir)\n\tdlog.Info(\"Init Console\")\n\tgo debugConsole(debugResetCh, skipSceneCh, os.Stdin)\n\tdlog.Info(\"Init Main Driver\")\n\tdriver.Main(lifecycleLoop)\n}",
"func (c *Client) init() {\n\tif c.domains == nil {\n\t\tc.domains = map[int]string{}\n\t}\n\tif c.cfg == nil {\n\t\tc.cfg = manager.NewAtomicConfig(tg.Config{})\n\t}\n\tc.ready = tdsync.NewResetReady()\n\tc.restart = make(chan struct{})\n\tc.migration = make(chan struct{}, 1)\n\tc.sessions = map[int]*pool.SyncSession{}\n\tc.subConns = map[int]CloseInvoker{}\n\tc.invoker = chainMiddlewares(InvokeFunc(c.invokeDirect), c.mw...)\n\tc.tg = tg.NewClient(c.invoker)\n}",
"func (s *Sprite) Init(e *Element) {\n\ts.ModuleBase.Init(e)\n\ts.Mask = e.RGBA(\"sprite_mask\", mat.White)\n\treg := e.Region(\"region\", s.Scene.Assets.Regions, mat.ZA)\n\n\tif reg == mat.ZA {\n\t\ts.Sprite.SetIntensity(0) // sprite will act as normal div\n\t} else {\n\t\ts.Sprite = ggl.NSprite(reg)\n\t}\n\ts.Sprite.SetColor(s.Mask)\n}",
"func (g *Gorc) Init() {\n\tg.Lock()\n\tg.count = 0\n\tg.waitMillis = 100 * time.Millisecond\n\tg.Unlock()\n}",
"func (node *Node) init() {\n\n\t//step0. parse config\n\n\tif err := node.parseConfig(node.configFile); err != nil {\n\t\t//temp code\n\t\tlog.Panicf(\"Parse Config Error: %s\", err.Error())\n\t\treturn\n\t}\n\n\t//step1. init process runtime and update node state to NodeStateInit\n\n\t//step2. try to connecting other nodes and store the connection to internalConns\n\n\t//init finnal. update node state to NodeStateNormal\n\n}",
"func InitGame(gridSize, numBombs int) *Game {\n\treturn &Game{\n\t\tgrid: InitGrid(gridSize, numBombs),\n\t\tstatus: InProgress,\n\t}\n}",
"func initClientReader(player *models.Player, host string) {\n\taddr := net.JoinHostPort(host, sendPort)\n\tlog.Printf(\"[Reader] Client is making a connection to %s\", addr)\n\n\tconn, err := net.Dial(\"tcp\", addr)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"[Reader] Client is connected\")\n\n\tgo addNewPlayer(player.Scene, conn)\n}",
"func (pwm *pwmGroup) init(config PWMConfig, start bool) error {\n\t// Not enable Phase correction\n\tpwm.setPhaseCorrect(false)\n\n\t// Clock mode set by default to Free running\n\tpwm.setDivMode(rp.PWM_CH0_CSR_DIVMODE_DIV)\n\n\t// Set Output polarity (false/false)\n\tpwm.setInverting(0, false)\n\tpwm.setInverting(1, false)\n\n\t// Set wrap. The highest value the counter will reach before returning to zero, also known as TOP.\n\tpwm.setWrap(0xffff)\n\t// period is set after TOP (Wrap).\n\terr := pwm.SetPeriod(config.Period)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// period already set beforea\n\t// Reset counter and compare (pwm level set to zero)\n\tpwm.CTR.ReplaceBits(0, rp.PWM_CH0_CTR_CH0_CTR_Msk, 0) // PWM_CH0_CTR_RESET\n\tpwm.CC.Set(0) // PWM_CH0_CC_RESET\n\n\tpwm.enable(start)\n\treturn nil\n}",
"func (b *blockEnc) init() {\n\tif b.lowMem {\n\t\t// 1K literals\n\t\tif cap(b.literals) < 1<<10 {\n\t\t\tb.literals = make([]byte, 0, 1<<10)\n\t\t}\n\t\tconst defSeqs = 20\n\t\tif cap(b.sequences) < defSeqs {\n\t\t\tb.sequences = make([]seq, 0, defSeqs)\n\t\t}\n\t\t// 1K\n\t\tif cap(b.output) < 1<<10 {\n\t\t\tb.output = make([]byte, 0, 1<<10)\n\t\t}\n\t} else {\n\t\tif cap(b.literals) < maxCompressedBlockSize {\n\t\t\tb.literals = make([]byte, 0, maxCompressedBlockSize)\n\t\t}\n\t\tconst defSeqs = 2000\n\t\tif cap(b.sequences) < defSeqs {\n\t\t\tb.sequences = make([]seq, 0, defSeqs)\n\t\t}\n\t\tif cap(b.output) < maxCompressedBlockSize {\n\t\t\tb.output = make([]byte, 0, maxCompressedBlockSize)\n\t\t}\n\t}\n\n\tif b.coders.mlEnc == nil {\n\t\tb.coders.mlEnc = &fseEncoder{}\n\t\tb.coders.mlPrev = &fseEncoder{}\n\t\tb.coders.ofEnc = &fseEncoder{}\n\t\tb.coders.ofPrev = &fseEncoder{}\n\t\tb.coders.llEnc = &fseEncoder{}\n\t\tb.coders.llPrev = &fseEncoder{}\n\t}\n\tb.litEnc = &huff0.Scratch{WantLogLess: 4}\n\tb.reset(nil)\n}",
"func (tr *TestRecorder) init() {}",
"func init() {\n\n}",
"func init() {\n\n}",
"func (c *contract) _init(ctx sdk.Context) error {\n\n\t// Save a key with the name \"name\" and string value \"Fun_Token\" in the state of the contract\n\tc.State.WriteStringByKey(ctx, \"name\", \"Fun_Token\")\n\n\t// Save a key with the name \"symbol\" and string value \"FUN\"\n\tc.State.WriteStringByKey(ctx, \"symbol\", \"FUN\")\n\n\t// Save a key with the name \"totalSupply\" and uint64 value \"FUN\" and return\n\treturn c.State.WriteUint64ByKey(ctx, \"totalSupply\", 1000000000)\n}",
"func init() {\n\t// TODO: set logger\n\t// TODO: register storage plugin to plugin manager\n}",
"func (a *AudioLog) Init(log *log.Logger, _ json.RawMessage) error {\n\ta.log = log\n\treturn nil\n}",
"func newPlayer(x, y int, right bool, moveTimer, shotTimer,\n\toxygen int) *player {\n\tsub := newSubmarine(x, y, right, moveTimer, shotTimer)\n\n\treturn &player{\n\t\tsubmarine: sub,\n\t\tremainingOxygen: oxygen,\n\t\tdiverCount: 0,\n\t}\n}",
"func init() {\n\tfmt.Println(\"Initialized\")\n}",
"func initServerGame() {\n\tkeyInput, boardOutput = network.InitServer()\n\n\tgo func() {\n\t\tfor {\n\t\t\tkey := <-*keyInput\n\n\t\t\tboardLock.Lock()\n\t\t\tboard.P2.SetDirection(key)\n\t\t\tboardLock.Unlock()\n\t\t}\n\t}()\n\n\tinitLocalStateManager()\n}",
"func (s *Layer) Init() {\n\ts.Delete()\n\n\ts.entities = []IEntity{}\n}",
"func init() {\n\tinitTokens()\n\tvar err error\n\tLexer, err = initLexer()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}",
"func (e *Element) init(s *Scene) {\n\tif e.Module == nil {\n\t\te.Module = &ModuleBase{}\n\t}\n\tif e.children.IsNil() {\n\t\te.children = NChildren()\n\t}\n\n\te.Scene = s\n\ts.InitStyle(e)\n\ts.addElement(e)\n\n\te.Module.Init(e)\n\tch := e.children.Slice()\n\tfor i := 0; i < len(ch); i++ {\n\t\tch[i].Value.init(s)\n\t}\n\te.Module.PostInit()\n}",
"func (d *deviceCommon) init(instance InstanceIdentifier, state *state.State, name string, conf config.Device, volatileGet VolatileGetter, volatileSet VolatileSetter) {\n\td.instance = instance\n\td.name = name\n\td.config = conf\n\td.state = state\n\td.volatileGet = volatileGet\n\td.volatileSet = volatileSet\n}",
"func (cr *chunkReader) init() (err error) {\n\tif cr.aead == nil {\n\t\t// For chacha20-poly1305, SaltSize is 32, NonceSize is 12 and Overhead is 16.\n\t\tsalt := make([]byte, cr.ssCipher.SaltSize())\n\t\tif _, err := io.ReadFull(cr.reader, salt); err != nil {\n\t\t\tif err != io.EOF && err != io.ErrUnexpectedEOF {\n\t\t\t\terr = fmt.Errorf(\"failed to read salt: %v\", err)\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\tcr.aead, err = cr.ssCipher.Decrypter(salt)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create AEAD: %v\", err)\n\t\t}\n\t\tcr.counter = make([]byte, cr.aead.NonceSize())\n\t\tcr.buf = make([]byte, payloadSizeMask+cr.aead.Overhead())\n\t}\n\treturn nil\n}",
"func (pq *PQueue) init(max int) {\n\tpq.queue = make([]int, max+3)\n\tpq.max = max\n\tpq.pos = 1\n}",
"func init() {\n\tresetConnection()\n}",
"func (s *StreamingDriver) Init(pipeline plugins.SFPipeline) error {\n\ts.pipeline = pipeline\n\treturn nil\n}"
] | [
"0.65159065",
"0.65004194",
"0.6413254",
"0.6379241",
"0.62930393",
"0.6197151",
"0.6149264",
"0.6026874",
"0.593727",
"0.58678484",
"0.5866485",
"0.5839084",
"0.5800773",
"0.5747296",
"0.57451427",
"0.5694042",
"0.56623226",
"0.5645326",
"0.56179804",
"0.5587653",
"0.5583001",
"0.5549942",
"0.5545528",
"0.5531862",
"0.5531862",
"0.5531862",
"0.5531862",
"0.5528856",
"0.5526286",
"0.5519381",
"0.55102897",
"0.55075634",
"0.5506474",
"0.5502109",
"0.5495018",
"0.5488027",
"0.54867923",
"0.5456722",
"0.543134",
"0.5429868",
"0.542591",
"0.5412758",
"0.54078805",
"0.5403037",
"0.53911155",
"0.5387455",
"0.53796434",
"0.53754497",
"0.53646946",
"0.5318162",
"0.5315287",
"0.53016454",
"0.5287117",
"0.52785957",
"0.52767473",
"0.52729595",
"0.5260165",
"0.52599853",
"0.5256836",
"0.52524966",
"0.5249897",
"0.5247751",
"0.5231978",
"0.52204186",
"0.5218682",
"0.5206947",
"0.52021444",
"0.5179473",
"0.51770896",
"0.51703984",
"0.51699036",
"0.5167702",
"0.5165769",
"0.51619494",
"0.5160124",
"0.51583135",
"0.5149495",
"0.5147871",
"0.5136127",
"0.5132969",
"0.5131826",
"0.5131195",
"0.51264393",
"0.5125694",
"0.5119399",
"0.5119399",
"0.51191926",
"0.5117657",
"0.51161724",
"0.5113376",
"0.51130664",
"0.5109418",
"0.509736",
"0.5094585",
"0.50917554",
"0.5080281",
"0.50685394",
"0.50662434",
"0.5064887",
"0.50636816"
] | 0.75993264 | 0 |
waitEnd is used to wait the end of playing queue | func (player *musicPlayer) waitEnd() {
player.playQueueMutex.Lock()
defer player.playQueueMutex.Unlock()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (q *Queue) WaitFinish() {\n <- q.finishChan\n}",
"func (m *Music) Wait() {\n\t<-m.played\n}",
"func (p *EventReplay) Wait() {}",
"func (async *async) wait() {\n\t<-async.done\n}",
"func (w *Worker) WaitForFinish() {\n\t<-w.done\n}",
"func (ircConn *Connection) WaitForQueue() {\n\tfor ircConn.openQueries > 0 {\n\t\ttime.Sleep(1 * time.Millisecond)\n\t}\n}",
"func (m *Manager) waitForFinish() {\n\tm.state.wg.Wait()\n}",
"func (eq *EventQueue) Wait() {\n\teq.closingWaitGroup.Wait()\n}",
"func (gs *GameState) waitForPlayers() {\n\t// add any players who were not playing in the last round to the game\n\tfor _, c := range gs.clients {\n\t\tif !c.isPlaying {\n\t\t\tc.isPlaying = true\n\t\t\tgs.mx.Lock()\n\t\t\tgs.playerCount++\n\t\t\tgs.mx.Unlock()\n\t\t}\n\t}\n\tif gs.playerCount >= minplayers {\n\t\treturn\n\t}\n\t// using a select loop because it blocks the current routine\n\t// this avoids 100% cpu consumtion from a for {}\n\tselect {\n\tcase <-gs.start:\n\t\treturn\n\t}\n}",
"func (g *Group) Wait() error",
"func (s *status) ended() error { return s.set(\"ended\") }",
"func (r *result) Wait() {\n\t<-r.done\n}",
"func (t *SelfTester) EndWaitingForEvent() {\n\tt.waitingForEvent.Store(false)\n}",
"func (q *Queue) Finish() {\n\tq.mtx.Lock()\n\tdefer q.mtx.Unlock()\n\n\tq.isFinished = true\n\tq.cv.Broadcast()\n}",
"func (j *Job) Wait() { <-j.isDone }",
"func (b *base) waitForPlayers() bool {\n\tlog.Printf(\"[Match] Waiting for all the players to register, match: %s\", b.info.ID)\n\tnbConnections := int64(len(b.connections))\n\n\tcnt := context.Background()\n\tvar cancel func()\n\tcnt, cancel = context.WithTimeout(cnt, time.Second*5)\n\tif b.readyMatch.Acquire(cnt, nbConnections) != nil {\n\t\tcancel()\n\n\t\tcancelMessage := socket.RawMessage{}\n\t\tcancelMessage.ParseMessagePack(byte(socket.MessageType.GameCancel), GameCancel{\n\t\t\tType: 1,\n\t\t})\n\t\tb.broadcast(&cancelMessage)\n\t\tcbroadcast.Broadcast(match2.BGameEnds, b.info.ID)\n\t\treturn false\n\t}\n\tcancel()\n\t//Send a message to all the clients to advise them that the game is starting\n\tmessage := socket.RawMessage{}\n\tmessage.MessageType = byte(socket.MessageType.GameStarting)\n\tb.broadcast(&message)\n\treturn true\n}",
"func TestCommandQueueExclusiveEnd(t *testing.T) {\n\tdefer leaktest.AfterTest(t)()\n\tcq := NewCommandQueue(true)\n\tadd(cq, roachpb.Key(\"a\"), roachpb.Key(\"b\"), false, nil)\n\n\t// Verify no wait on the second writer command on \"b\" since\n\t// it does not overlap with the first command on [\"a\", \"b\").\n\twaitCmdDone(getPrereqs(cq, roachpb.Key(\"b\"), nil, false))\n}",
"func (s *Streamer) Wait() error {\n\treturn <-s.donec\n}",
"func (q *Queue) Wait() error {\n\tq.m.Lock()\n\n\tif q.closed {\n\t\tq.m.Unlock()\n\t\treturn fmt.Errorf(\"Channel closed\")\n\t}\n\n\tif q.i < q.j {\n\t\tq.m.Unlock()\n\t\treturn nil\n\t}\n\n\tq.m.Unlock()\n\n\t_, ok := <-q.idleCh\n\tif !ok {\n\t\treturn fmt.Errorf(\"Channel closed\")\n\t}\n\n\treturn nil\n}",
"func (b *base) waitTimeout() bool {\n\tc := make(chan struct{})\n\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-time.After(time.Second):\n\t\t\t\t//Send an update to the clients\n\t\t\t\tb.funcSyncPlayer()\n\t\t\tcase <-c:\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\n\tcnt := context.Background()\n\tcnt, b.cancelWait = context.WithTimeout(cnt, time.Millisecond*time.Duration(b.timeImage))\n\terr := b.waitingResponse.Acquire(cnt, b.nbWaitingResponses)\n\tb.cancelWait()\n\n\tclose(c)\n\n\tif err == nil {\n\t\tb.receivingGuesses.UnSet()\n\t\treturn false // completed normally\n\t}\n\n\tb.receivingGuesses.UnSet()\n\treturn true // timed out\n}",
"func waitListen(q Queue, freq <-chan time.Time, seq chan int) {\n\tListen(q, freq)\n\tseq <- 3\n}",
"func (k *Kuzzle) PlayQueue() {\n\tif k.protocol.IsReady() {\n\t\tk.cleanQueue()\n\t\tk.dequeue()\n\t}\n}",
"func (l *CommandQueueStatusListener) Wait() {\n\t<-l.signal\n}",
"func (m *Music) WaitLine() {\n\t<-m.linePlayed\n}",
"func (a *Async) Wait() {\n\ta.waiting = true\n\t<-a.done\n}",
"func (player *musicPlayer) playQueue(trim float64, ch chan error) {\n\tplayer.playQueueMutex.Lock()\n\tdefer player.playQueueMutex.Unlock()\n\tplay := true\n\tfirst := true\n\tplayer.Lock()\n\tplayer.state.status = waiting\n\tplayer.Unlock()\n\tfor play {\n\t\tvar fileName string\n\t\tplayer.Lock()\n\t\tif player.state.status == paused {\n\t\t\tplay = false\n\t\t} else {\n\t\t\tindex := player.state.current\n\t\t\tif index < len(player.state.queue) {\n\t\t\t\tfileName = player.state.queue[index]\n\t\t\t} else {\n\t\t\t\tplay = false\n\t\t\t\tplayer.state.current = 0\n\t\t\t\tplayer.state.status = waiting\n\t\t\t}\n\t\t}\n\t\tplayer.Unlock()\n\n\t\tif play && len(fileName) > 0 {\n\t\t\tfmt.Println(\"play queue - song to be played \", fileName)\n\t\t\tif first {\n\t\t\t\tfirst = false\n\t\t\t\tplayer.playSingleFile(fileName, trim, ch)\n\t\t\t} else {\n\t\t\t\tplayer.playSingleFile(fileName, trim, nil)\n\t\t\t}\n\t\t\ttrim = 0\n\n\t\t\tplayer.Lock()\n\t\t\tif player.state.status == waiting {\n\t\t\t\tplayer.state.current += 1\n\t\t\t}\n\t\t\tplayer.Unlock()\n\t\t}\n\t}\n}",
"func (q *Queue) Wait() {\n\tq.cond.Wait()\n}",
"func (b *backgroundUploader) WaitFinished() error {\n\tn := cap(b.uploadersDone)\n\n\tclose(b.uploadJobs)\n\n\tfor i := 0; i < n; i++ {\n\t\tif err := <-b.uploadersDone; err != nil {\n\t\t\treturn fmt.Errorf(\"at least one uploader encountered job error: %v\", err)\n\t\t}\n\t}\n\n\tb.uploadProgress.Close()\n\n\treturn nil\n}",
"func (e ClientEvent) End() time.Time { return e.ClientRecv }",
"func Wait() {\n\t<-wait\n}",
"func (q *testQueue) stop() {\n\tif atomic.LoadInt32(&q.active) == 0 {\n\t\treturn\n\t}\n\n\tatomic.StoreInt32(&q.active, 0)\n\n\tclose(q.wait)\n\tq.muw.Lock()\n\tq.wg.Wait()\n\tq.muw.Unlock()\n}",
"func (t *ElapsedTimeout) Wait(context.Context) error { return nil }",
"func (tfcm *TestFCM) wait(count int) {\n\ttime.Sleep(time.Duration(count) * tfcm.timeout)\n}",
"func (q *EventQueue) WaitToBeDrained() {\n\tif q == nil {\n\t\treturn\n\t}\n\t<-q.close\n\n\t// If the queue is running, then in-flight events may still be ongoing.\n\t// Wait for them to be completed for the queue to be fully drained. If the\n\t// queue is not running, we must forcefully run it because nothing else\n\t// will so that it can be drained.\n\tgo q.run()\n\t<-q.eventsClosed\n}",
"func (e *Executor) Wait() { <-e.exit }",
"func (t *SyncTransport) Wait() {}",
"func (e ServerEvent) End() time.Time { return e.ServerSend }",
"func (s *Serv) Wait() {\n\t<-s.done\n}",
"func (pb *PageBuffer) End() bool {\n return pb.is_end\n}",
"func (g *Group) WaitTillReady() {\n\t<-g.readyCh\n}",
"func (cfg *config) end() {\n\tcfg.checkTimeout()\n\tif cfg.t.Failed() == false {\n\t\tcfg.mu.Lock()\n\t\tt := time.Since(cfg.t0).Seconds() // real time\n\t\tnpeers := cfg.n // number of Raft peers\n\t\tnrpc := cfg.rpcTotal() - cfg.rpcs0 // number of RPC sends\n\t\tnbytes := cfg.bytesTotal() - cfg.bytes0 // number of bytes\n\t\tncmds := cfg.maxIndex - cfg.maxIndex0 // number of Raft agreements reported\n\t\tcfg.mu.Unlock()\n\n\t\tfmt.Printf(\" ... Passed --\")\n\t\tfmt.Printf(\" %4.1f %d %4d %7d %4d\\n\", t, npeers, nrpc, nbytes, ncmds)\n\t}\n}",
"func (p *Plugin) Wait() {\n\t<-p.After()\n}",
"func (eb exponentialBackoff) wait() {\n\ttime.Sleep(eb.currentDelay)\n\teb.currentDelay = eb.b.Duration()\n}",
"func Wait() {\n\tfor {\n\t\ttime.Sleep(time.Millisecond)\n\t\tif messages == nil || len(messages) == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}",
"func (tb *Testbed) Wait(timeout time.Duration) error {\n\tdefer tb.cancel()\n\tnow := time.Now()\n\tselect {\n\tcase <-tb.donec:\n\t\treturn nil\n\tcase to := <-time.After(timeout):\n\t\twaited := to.Sub(now)\n\t\treturn errors.New(\"timeout after \" + waited.String())\n\t}\n}",
"func (twrkr *twerk) Wait() {\n\tif twrkr.stop {\n\t\treturn\n\t}\n\tticker := time.NewTicker(100 * time.Microsecond)\n\tdefer ticker.Stop()\n\n\tfor range ticker.C {\n\t\tif len(twrkr.jobListener) == 0 && twrkr.liveWorkersNum.Get() == 0 && twrkr.currentlyWorkingNum.Get() == 0 {\n\t\t\treturn\n\t\t}\n\t}\n}",
"func (b *buildandrun) Wait() {\n\t<-b.done\n}",
"func (b *basebackup) Wait() {\n\tb.wg.Wait()\n}",
"func EndProgress() {\n\tendTime = time.Now().Round(time.Second)\n\tendChan <- true\n\tclose(endChan)\n}",
"func (m *OutboundMock) Wait(timeout time.Duration) {\n\tm.MinimockWait(timeout)\n}",
"func wait() {\n\twaitImpl()\n}",
"func (play *Play) Done() {\n\tcount := play.PhaseCount()\n\tplay.phases[count-1].active = false\n}",
"func (e *endpoint) Wait() {\n\te.completed.Wait()\n}",
"func (buf *CommandBuffer) End() error {\n\tres := Result(C.domVkEndCommandBuffer(buf.fps[vkEndCommandBuffer], buf.hnd))\n\treturn result2error(res)\n}",
"func (p *Input) Wait() {\n\tp.Stop()\n}",
"func waitForCompletion(done chan bool) bool {\n\ttimer := time.NewTimer(totalWaitTime)\n\tdefer timer.Stop()\n\tselect {\n\tcase <-done:\n\t\treturn true\n\tcase <-timer.C:\n\t\treturn false\n\t}\n}",
"func (b *Board) IsEnd() bool {\n\tif b.Finish {\n\t\treturn true\n\t}\n\tfor _, p := range b.Players {\n\t\tif p.fieldCounter == FieldLength {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}",
"func (b *Bot) WaitUntilCompletion() {\n\tb.server.Wait()\n}",
"func (b *Bot) WaitForHalt() {\n\tb.msgDispatchers.Wait()\n\tb.dispatcher.WaitForCompletion()\n\tb.serversProtect.RLock()\n\tfor _, srv := range b.servers {\n\t\tsrv.dispatcher.WaitForCompletion()\n\t}\n\tb.serversProtect.RUnlock()\n}",
"func (c *Connection) recvWait(packetQueue chan PacketQueue) {\n\tbuf := make([]byte, MaxBufferByteSize)\n\n\tfor {\n\t\tsize, err := c.conn.Read(buf)\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tc.close()\n\t\t\t\tlog.Debug(\"Disconnected connection.\", c.conn.RemoteAddr())\n\t\t\t} else if nerr, ok := err.(net.Error); ok && nerr.Timeout() {\n\t\t\t\tlog.Error(err)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\tif size < MinBufferByteSize {\n\t\t\tlog.Warn(\"Not enough length of minimum packet size.\", spew.Sprint(buf[:]))\n\t\t\tcontinue\n\t\t}\n\n\t\tif size > MaxBufferByteSize {\n\t\t\tlog.Warn(\"Too long size packet.\", spew.Sprint(buf[:]))\n\t\t\tcontinue\n\t\t}\n\n\t\tlog.Debug(spew.Sprint(buf[:size]))\n\n\t\tpacketQueue <- PacketQueue{\n\t\t\tPacket: buf[:size],\n\t\t\tConnection: c,\n\t\t}\n\t}\n}",
"func (r SortedRunner) Wait() error {\n\treturn nil\n}",
"func wait(stop chan bool, timeout time.Duration, workers int) {\n\ttime.Sleep(timeout)\n\tclose(stop)\n}",
"func (_m *Manager) WaitStop() {\n\t_m.Called()\n}",
"func (t *Tailer) wait() {\n\ttime.Sleep(t.sleepDuration)\n}",
"func (p *PrioritySchedulingQueue) flushBackoffQCompleted() {\n\tp.Lock()\n\tdefer p.Unlock()\n\tfor {\n\t\trawQUInfo := p.backoffQ.Peek()\n\t\tif rawQUInfo == nil {\n\t\t\treturn\n\t\t}\n\n\t\tqu := rawQUInfo.(*framework.QueueUnitInfo)\n\t\tboTime := p.getBackoffTime(qu)\n\t\tif boTime.After(p.clock.Now()) {\n\t\t\treturn\n\t\t}\n\t\t_, err := p.backoffQ.Pop()\n\t\tif err != nil {\n\t\t\tklog.Errorf(\"Unable to pop pod %v from backoff queue despite backoff completion.\", qu.Unit.Namespace+\"/\"+qu.Unit.Name)\n\t\t\treturn\n\t\t}\n\t\terr = p.items.Add(rawQUInfo)\n\t\tif err != nil {\n\t\t\tklog.Errorf(\"Unable to add pod %v back to active queue despite backoff completion.\", qu.Unit.Namespace+\"/\"+qu.Unit.Name)\n\t\t\treturn\n\t\t}\n\t}\n}",
"func (pm *collection) waitForRunnableToEnd(ctx context.Context, cancel context.CancelFunc) error {\n\tdefer cancel()\n\n\tgo func() {\n\t\tpm.waitForRunnable.Wait()\n\t\tcancel()\n\t}()\n\n\t<-ctx.Done()\n\tif err := ctx.Err(); err != nil && err != context.Canceled {\n\t\treturn fmt.Errorf(\n\t\t\t\"failed waiting for all runnables to end within grace period of %s: %w\",\n\t\t\tpm.gracefulShutdownTimeout, err)\n\t}\n\treturn nil\n}",
"func (p *buffersPool) eof() {\n\tp.ws.Wait()\n\tclose(p.ready)\n}",
"func (ep *ExpectProcess) Wait() {\n\tep.wg.Wait()\n}",
"func (a *Application) Wait() {\n\t<-a.terminated\n\tlog.Printf(\"[TEST] thats all folks\")\n}",
"func (b *EventBus) Wait() {\n\tb.wg.Wait()\n\n\tif err := b.amqpChannel.Close(); err != nil {\n\t\tlog.Printf(\"eventhorizon: failed to close RabbitMQ queue: %s\", err)\n\t}\n\n\tif err := b.amqpConn.Close(); err != nil {\n\t\tlog.Printf(\"eventhorizon: failed to close RabbitMQ connection: %s\", err)\n\t}\n}",
"func (ep *defaultEventProcessor) waitUntilInactive() {\n\tm := syncEventsMessage{replyCh: make(chan struct{})}\n\tep.inputCh <- m\n\t<-m.replyCh // Now we know that all events prior to this call have been processed\n}",
"func FlushWaitQReq() {\n\tgqi.flushWaitQReq()\n}",
"func (d *Download) Wait() {\n\t<-d.done\n}",
"func (c *BFTChain) WaitReady() error {\n\treturn nil\n}",
"func (p *Player) endRound() {\n\tp.hands = nil\n}",
"func (c *apiConsumers) Wait() {\n\tc.wait()\n}",
"func WaitForNotify() {\n\tcount++\n\t<-done\n}",
"func (e *Executor) Wait() {\n\tfor {\n\t\tnjob, ndone := e.Count()\n\t\tif ndone == njob {\n\t\t\tbreak\n\t\t}\n\t\ttime.Sleep(100 * time.Millisecond)\n\t}\n}",
"func (fn *FolderNode) waitAvailable() bool {\n\tselect {\n\tcase <-fn.stop:\n\t\treturn false\n\tdefault:\n\t\tselect {\n\t\tcase <-fn.ava:\n\t\t\treturn true\n\t\tcase <-fn.stop:\n\t\t\treturn false\n\t\t}\n\t}\n}",
"func (results *Results) End() {\n\tresults.Duration = time.Since(results.Start)\n}",
"func (t *Terminal) Wait() {\n\tfor <-t.stopChan {\n\t\treturn\n\t}\n}",
"func (m *ShifterMock) Wait(timeout time.Duration) {\n\tm.MinimockWait(timeout)\n}",
"func (a *Application) Wait() {\n\t<-a.terminated\n}",
"func (r *TestRequest) End(offset, length uint64, flags int, errval int) error {\n\tr.handleProgressReceived <- &TestProgressUpdate{\n\t\tCookie: r.cookie,\n\t\tOffset: offset,\n\t\tLength: length,\n\t\tFlags: flags,\n\t\tTotal: length,\n\t\tErrval: errval,\n\t\tComplete: true,\n\t}\n\tclose(r.handleProgressReceived)\n\treturn nil\n}",
"func (ar *AppendResult) Ready() <-chan struct{} { return ar.ready }",
"func (q *QueuedOutput) WaitForEmpty(ctx context.Context) error {\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\t\tcase <-time.After(50 * time.Millisecond):\n\t\t\tif len(q.queue) == 0 {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n}",
"func wait(_ time.Time, waitingMessage string) error {\n\tlog.Info(waitingMessage)\n\ttime.Sleep(waitSleep)\n\treturn nil\n}",
"func (w *AMQPWorker) Wait(timeout time.Duration) error {\n\tll := log.WithFields(log.Fields{\n\t\t\"where\": \"AMQPWorker.Wait\",\n\t})\n\tif w.lastTag < 1 {\n\t\tll.Warning(\"no records were sent\")\n\t\treturn nil\n\t}\n\tvar tc <-chan time.Time\n\tif timeout > 0 {\n\t\ttc = time.After(timeout)\n\t} else {\n\t\ttc = make(<-chan time.Time)\n\t}\n\tvar returns, nacks int\nWaitLoop:\n\tfor {\n\t\tselect {\n\t\tcase <-tc:\n\t\t\tll.WithFields(log.Fields{\n\t\t\t\t\"timeout\": timeout.String(),\n\t\t\t}).Warning(\"timed out while waiting for confirms\")\n\t\t\treturn NewAMQPError(\"timed out while waiting for confirms\")\n\t\tcase c := <-w.closing:\n\t\t\tll.WithFields(log.Fields{\n\t\t\t\t\"code\": c.Code,\n\t\t\t\t\"reason\": c.Reason,\n\t\t\t\t\"server-initiated\": c.Server,\n\t\t\t\t\"can-recover\": c.Recover,\n\t\t\t}).Error(\"channel closed\")\n\t\t\treturn NewAMQPError(\"channel closed while waiting for confirms\")\n\t\tcase ret := <-w.returns:\n\t\t\tll.WithFields(log.Fields{\n\t\t\t\t\"code\": ret.ReplyCode,\n\t\t\t\t\"reason\": ret.ReplyText,\n\t\t\t}).Warning(\"record returned\")\n\t\t\treturns++\n\t\tcase confirm := <-w.confirms:\n\t\t\tll.WithFields(log.Fields{\n\t\t\t\t\"tag\": confirm.DeliveryTag,\n\t\t\t\t\"ack\": confirm.Ack,\n\t\t\t}).Debug(\"confirm\")\n\t\t\tif !confirm.Ack {\n\t\t\t\tnacks++\n\t\t\t}\n\t\t\tif confirm.DeliveryTag >= w.lastTag {\n\t\t\t\tbreak WaitLoop\n\t\t\t}\n\t\t}\n\t}\n\tif returns > 0 {\n\t\treturn NewAMQPError(fmt.Sprintf(\"%d records were returned\", returns))\n\t}\n\tif nacks > 0 {\n\t\treturn NewAMQPError(fmt.Sprintf(\"%d records were not successfully sent\", nacks))\n\t}\n\tlog.Debug(\"all records sent successfully\")\n\treturn nil\n}",
"func (kcp *KCP) WaitSnd() int {\n\treturn len(kcp.snd_buf) + len(kcp.snd_queue)\n}",
"func (t *Tournament) End() {\n\tif !t.hasEnded() {\n\t\tn := t.generateWinnerNum()\n\n\t\tt.Winner = Winner{\n\t\t\tPlayer: t.Participants[n],\n\t\t\tPrize: t.Deposit,\n\t\t}\n\n\t\tt.Participants[n].Fund(t.Deposit)\n\t\tt.Balance = 0\n\t}\n}",
"func (m *TesterMock) Wait(timeout time.Duration) {\n\tm.MinimockWait(timeout)\n}",
"func (bus *EventBus) WaitAsync() {\n\tbus.wg.Wait()\n}",
"func (bus *EventBus) WaitAsync() {\n\tbus.wg.Wait()\n}",
"func (ircConn *Connection) Wait() {\n\tfor ircConn.openQueries > 0 {\n\t\ttime.Sleep(1 * time.Millisecond)\n\t}\n\t<-waitingChannel\n}",
"func (rc Ctx) End() time.Time {\n\treturn rc.requestEnd\n}",
"func (e *WindowsEvent) Wait() {\n\te.WaitTimeout(-1)\n}",
"func (s *Server) Wait() {\n\t<-s.stopChan\n}",
"func (s *Server) Wait() {\n\t<-s.stopChan\n}",
"func waitAnyEndSignal(handlerEnd chan error, signals <-chan os.Signal, amqpCloseConnection chan *amqp.Error, endConnection chan int, handlerCount int) {\n\tselect {\n\tcase <-handlerEnd:\n\t\tlogger.Warning(\"[lib.amqp#waitAnyEndSignal] Received end signal from handleMessage function\")\n\t\tmetrics.Increment(\"amqp.signals.handler_exited\")\n\t\thandlerCount--\n\t\tendConnection <- 0\n\tcase signal := <-signals:\n\t\tlogger.WithField(\"signal\", signal).Info(\"[lib.amqp#waitAnyEndSignal] Received signal from OS\")\n\t\tmetrics.Increment(\"amqp.signals.os_exit\")\n\t\tendConnection <- 0\n\tcase amqpError := <-amqpCloseConnection:\n\t\tlogger.WithField(\"connectionError\", amqpError).Error(\"[lib.amqp#waitAnyEndSignal] Received error from AMQP connection\")\n\t\tmetrics.Increment(\"amqp.signals.amqp_lost_connection\")\n\t}\n\twaitForHandlers(handlerEnd, handlerCount)\n}",
"func (s *BasePlSqlParserListener) ExitWait_nowait_part(ctx *Wait_nowait_partContext) {}"
] | [
"0.6722909",
"0.6711166",
"0.63364303",
"0.6256194",
"0.60566604",
"0.60402995",
"0.5934097",
"0.58663464",
"0.5863885",
"0.57432836",
"0.57182705",
"0.5690095",
"0.5673604",
"0.5608103",
"0.55525565",
"0.55524963",
"0.5551658",
"0.55320144",
"0.54965353",
"0.54899",
"0.5487658",
"0.54817957",
"0.5476996",
"0.54326683",
"0.54278713",
"0.53887856",
"0.53824836",
"0.5365109",
"0.5329291",
"0.53261846",
"0.53246564",
"0.53117573",
"0.5309463",
"0.5300465",
"0.52904624",
"0.52885616",
"0.5280732",
"0.52724487",
"0.5261696",
"0.52504295",
"0.52334756",
"0.522749",
"0.5226151",
"0.5225423",
"0.5206039",
"0.5193184",
"0.5187606",
"0.5184713",
"0.51776826",
"0.51576805",
"0.51558137",
"0.5150098",
"0.5134064",
"0.51329005",
"0.51268905",
"0.51221865",
"0.51210713",
"0.5120291",
"0.5118449",
"0.51165956",
"0.51021993",
"0.51001143",
"0.5099651",
"0.5099069",
"0.50791425",
"0.50784963",
"0.507004",
"0.5063183",
"0.5060651",
"0.50493026",
"0.50472593",
"0.50454986",
"0.5044675",
"0.504173",
"0.5032538",
"0.50298065",
"0.5029088",
"0.50242025",
"0.5017953",
"0.50174725",
"0.5001909",
"0.4997636",
"0.49896622",
"0.49853173",
"0.49839774",
"0.49810877",
"0.4979403",
"0.49772286",
"0.49756396",
"0.49714604",
"0.4971202",
"0.4969474",
"0.4969474",
"0.49683246",
"0.49643",
"0.49589843",
"0.4955884",
"0.4955884",
"0.49495888",
"0.4945236"
] | 0.8340487 | 0 |
playSingleFile plays single file Returns error if file could not be played | func (player *musicPlayer) playSingleFile(filename string, trim float64, ch chan error) error {
// Open the input file (with default parameters)
in := sox.OpenRead(filename)
if in == nil {
err := errors.New(no_sox_in_msg)
if ch != nil {
ch <- err
}
return err
}
defer in.Release()
// Open the output device: Specify the output signal characteristics.
// Since we are using only simple effects, they are the same as the
// input file characteristics.
// Using "alsa" or "pulseaudio" should work for most files on Linux.
// "coreaudio" for OSX
// On other systems, other devices have to be used.
out := sox.OpenWrite("default", in.Signal(), nil, "alsa")
if out == nil {
out = sox.OpenWrite("default", in.Signal(), nil, "pulseaudio")
if out == nil {
out = sox.OpenWrite("default", in.Signal(), nil, "coreaudio")
if out == nil {
out = sox.OpenWrite("default", in.Signal(), nil, "waveaudio")
if out == nil {
err := errors.New(no_sox_out_msg)
if ch != nil {
ch <- err
}
return err
}
}
}
}
// It's observed that sox crashes at this step sometimes
defer out.Release()
if ch != nil {
ch <- nil
}
// Create an effects chain: Some effects need to know about the
// input or output encoding so we provide that information here.
chain := sox.CreateEffectsChain(in.Encoding(), out.Encoding())
defer chain.Release()
// The first effect in the effect chain must be something that can
// source samples; in this case, we use the built-in handler that
// inputs data from an audio file.
e := sox.CreateEffect(sox.FindEffect("input"))
e.Options(in)
// This becomes the first "effect" in the chain
chain.Add(e, in.Signal(), in.Signal())
e.Release()
if trim > 0 {
interm_signal := in.Signal().Copy()
e = sox.CreateEffect(sox.FindEffect("trim"))
e.Options(strconv.FormatFloat(trim, 'f', 2, 64))
chain.Add(e, interm_signal, in.Signal())
e.Release()
}
// The last effect in the effect chain must be something that only consumes
// samples; in this case, we use the built-in handler that outputs data.
e = sox.CreateEffect(sox.FindEffect("output"))
e.Options(out)
chain.Add(e, in.Signal(), in.Signal())
e.Release()
player.Lock()
player.state.chain = chain
player.state.status = playing
player.state.startTime = time.Now()
if trim > 0 {
var milis int64 = int64(-trim * 1000)
player.state.startTime = player.state.startTime.Add(time.Duration(milis) * time.Millisecond)
}
player.Unlock()
// Flow samples through the effects processing chain until EOF is reached.
// Flow process is not locked as it must be possible to delete chain effects
// while Flow is being executed
// note: sox crashes at this step sometimes(rarely)
chain.Flow()
player.Lock()
if player.state.status == playing {
player.state.status = waiting
}
player.Unlock()
return nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (player *AudioPlayer) PlayFile(fileName string) error {\n\tmplayer := exec.Command(\"mplayer\", player.AudioFolder+\"/\"+fileName+\".mp3\")\n\treturn mplayer.Run()\n}",
"func (s *Service) PlayFile(path string) error {\n\t// check if file exists if it is not a remote video.\n\tif _, err := os.Stat(path); os.IsNotExist(err) && !strings.Contains(path, \"http\") {\n\t\ts.client.logger.WithFields(log.Fields{\"path\": path}).Info(ErrFileNotFound)\n\t\treturn ErrFileNotFound\n\t}\n\n\t// start playing file.\n\tif err := s.SetProperty(\"pause\", \"no\"); err != nil {\n\t\treturn err\n\t}\n\tif err := s.SetCommand(\"loadfile\", path); err != nil {\n\t\treturn err\n\t}\n\ts.client.logger.WithFields(log.Fields{\"video\": path}).Info(\"playing video\")\n\treturn nil\n}",
"func playHelper(fname string) {\n\tcolorprint.Info(\">>>> Please enter the name of the file that you would like to play\")\n\tfmt.Scan(&fname)\n\tcolorprint.Debug(\"<<<< \" + fname)\n\tplayer.Filename = fname\n\tfor _, element := range filePaths.Files {\n\t\tif element.Name == fname {\n\t\t\tplayer.Filepath = element.Path\n\t\t}\n\t}\n\n\tplayer.Run()\n}",
"func (f *FilePlayer) Play(fileName string, fileType string, device string) (err error) {\n\toptions, err := producePlayOptions(fileName, fileType, device)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgo playAudio(options, f.doneCh)\n\treturn\n}",
"func RunSound(path string) {\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\t// Create a new beep.Decoder\n\tstreamer, format, err := mp3.Decode(f)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\tdefer streamer.Close()\n\t// Create a new beep.Player\n\tspeaker.Init(format.SampleRate, format.SampleRate.N(time.Second/10))\n\n\tdone := make(chan bool)\n\t// Play the stream\n\tspeaker.Play(beep.Seq(streamer, beep.Callback(func() {\n\t\tdone <- true\n\t})))\n\n\t<-done\n}",
"func (n *Notifier) Play(ctx context.Context, url string) error {\n\tmedia, err := n.client.Media(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\titem := controllers.MediaItem{\n\t\tContentId: url,\n\t\tStreamType: \"BUFFERED\",\n\t\tContentType: \"audio/mpeg\",\n\t}\n\t_, err = media.LoadMedia(ctx, item, 0, true, map[string]interface{}{})\n\treturn err\n}",
"func (c *Client) Play(url string) (e error) {\n\tclient := cast.NewClient(c.ip, c.port)\n\tdefer func() {\n\t\tif err := recover(); err != nil {\n\t\t\te = fmt.Errorf(\"Panic occurs on Play [%w]\", err)\n\t\t}\n\t}()\n\n\terr := client.Connect(c.ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer client.Close()\n\tclient.Receiver().QuitApp(c.ctx)\n\n\tmedia, err := client.Media(c.ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\titem := controllers.MediaItem{\n\t\tContentId: url,\n\t\tStreamType: \"BUFFERED\",\n\t\tContentType: \"audio/mpeg\",\n\t}\n\t_, err = media.LoadMedia(c.ctx, item, 0, true, map[string]interface{}{})\n\treturn err\n}",
"func (c *Client) PlaySound(path string) error {\n\tfh, err := os.Open(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer fh.Close()\n\n\tbytes, err := ioutil.ReadAll(fh)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgo c.playRaw(bytes)\n\treturn nil\n}",
"func CallPlayer(file string) {\n\tvar player string\n\tif runtime.GOOS == \"windows\" {\n\t\tplayer = \"PotPlayerMini.exe\"\n\t} else {\n\t\tplayer = \"mpv\"\n\t}\n\texec.Command(player, file).Start()\n}",
"func (p *Player) Play(c context.Context, sr *streamfile.EventStreamReader) {\n\t// Stop any currently-playing file.\n\tp.Stop()\n\n\t// We will cancel the Context ourselves on Stop. Retain this Context.\n\tp.ctx, p.cancelFunc = context.WithCancel(c)\n\tc = p.ctx\n\n\t// Initialize player resources.\n\tp.playback = &playerPlayback{\n\t\tplayer: p,\n\t\tsr: sr,\n\t\tlogger: logging.Must(p.Logger),\n\t\tleaser: p.PlaybackLeaser,\n\t\tnoRouteDevices: make(map[int64]int64),\n\t\tcommandC: make(chan *playerCommand),\n\t\timmediateC: make(chan time.Time),\n\t\tfinishedC: make(chan struct{}),\n\t}\n\tclose(p.playback.immediateC) // Always closed.\n\n\t// Must not have a nil leaser.\n\tif p.playback.leaser == nil {\n\t\tp.playback.leaser = noopPlaybackLeaser{}\n\t}\n\n\t// Start the player goroutine.\n\t//\n\t// We will play until the Context is cancelled.\n\tgo func() {\n\t\tdefer func() {\n\t\t}()\n\t\tp.playback.playUntilStopped(c)\n\t}()\n}",
"func playSound(s *discordgo.Session, guildID, channelID string) (err_r error) {\n\n\tif playing {\n\t\treturn nil\n\t}\n\n\trand_num := rand.Int()%len(sliceData)\n\tmsg_string := sliceData[rand_num]\n\tfile_name := strconv.Itoa(rand_num)+\".mp3\"\n\tvar err error\n\tos.Setenv(\"GOOGLE_APPLICATION_CREDENTIALS\",\"INSERT YOUR GOOGLE CLOUD CREDENTIALS HERE\")\n\tif Exists(file_name) {\n\t\tlog.Println(\"file found: \", file_name)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Error opening mp3 file :\", err)\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tlog.Println(\"file not found: \", file_name)\n\t\tctx := context.Background()\n\n\t\tclient, err := texttospeech.NewClient(ctx)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tdefer client.Close()\n\n\t\t// Perform the text-to-speech request on the text input with the selected\n\t\t// voice parameters and audio file type.\n\t\treq := texttospeechpb.SynthesizeSpeechRequest{\n\t\t\t// Set the text input to be synthesized.\n\t\t\tInput: &texttospeechpb.SynthesisInput{\n\t\t\t\tInputSource: &texttospeechpb.SynthesisInput_Text{Text: msg_string},\n\t\t\t},\n\t\t\t// Build the voice request, select the language code and the SSML\n\t\t\t// voice gender.\n\t\t\tVoice: &texttospeechpb.VoiceSelectionParams{\n\t\t\t\tLanguageCode: \"ru-RU\",\n\t\t\t\tSsmlGender: texttospeechpb.SsmlVoiceGender_MALE,\n\t\t\t\tName: \"ru-RU-Wavenet-D\",\n\t\t\t},\n\t\t\t// Select the type of audio file you want returned.\n\t\t\tAudioConfig: &texttospeechpb.AudioConfig{\n\t\t\t\tAudioEncoding: texttospeechpb.AudioEncoding_MP3,\n\t\t\t},\n\t\t}\n\n\t\tresp, err := client.SynthesizeSpeech(ctx, &req)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\t// The resp's AudioContent is binary.\n\t\tfile_name = strconv.Itoa(rand_num) + \".mp3\"\n\t\terr = ioutil.WriteFile(file_name, resp.AudioContent, 0644)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tfmt.Printf(\"Audio content written to file: %v\\n\", file_name)\n\n\t\tlog.Println(file_name)\n\n\t}\n\n\t//encode mp3 to dca\n\toptions := dca.StdEncodeOptions\n\toptions.RawOutput = true\n\toptions.Bitrate = 128\n\toptions.Application = \"lowdelay\"\n\n\tencodeSession, err := dca.EncodeFile(file_name, options)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer encodeSession.Cleanup()\n\n\n\t// Join the provided voice channel.\n\tvc, err := s.ChannelVoiceJoin(guildID, channelID, false, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\tplaying = true\n\n\t// Sleep for a specified amount of time before playing the sound\n\ttime.Sleep(250 * time.Millisecond)\n\n\t// Start speaking.\n\tvc.Speaking(true)\n\n\tdone := make(chan error)\n\tdca.NewStream(encodeSession, vc, done)\n\terr = <-done\n\tif err != nil && err != io.EOF {\n\t\treturn\n\t}\n\n\t// Stop speaking\n\tvc.Speaking(false)\n\n\t// Sleep for a specified amount of time before ending.\n\ttime.Sleep(250 * time.Millisecond)\n\n\t// Disconnect from the provided voice channel.\n\tvc.Disconnect()\n\n\tplaying = false\n\n\treturn nil\n\n}",
"func (_m *Gamer) Play(args ...string) {\n\t_m.Called(args)\n}",
"func (asf *File) Play(animName string) {\n\tcur := asf.GetAnimation(animName)\n\tif cur == nil {\n\t\tlog.Fatal(`Error: Animation named \"` + animName + `\" not found in Aseprite file!`)\n\t}\n\tif asf.CurrentAnimation != cur {\n\t\tasf.CurrentAnimation = cur\n\t\tasf.finishedAnimation = false\n\t\tasf.CurrentFrame = asf.CurrentAnimation.Start\n\t\tif asf.CurrentAnimation.Direction == PlayBackward {\n\t\t\tasf.CurrentFrame = asf.CurrentAnimation.End\n\t\t}\n\t\tasf.pingpongedOnce = false\n\t}\n}",
"func (g *CastDevice) Play(ctx context.Context, url *url.URL) error {\n\tconn := castnet.NewConnection()\n\tif err := conn.Connect(ctx, g.AddrV4, g.Port); err != nil {\n\t\treturn err\n\t}\n\tdefer conn.Close()\n\n\tstatus, err := g.client.Receiver().LaunchApp(ctx, cast.AppMedia)\n\tif err != nil {\n\t\treturn err\n\t}\n\tapp := status.GetSessionByAppId(cast.AppMedia)\n\n\tcc := controllers.NewConnectionController(conn, g.client.Events, cast.DefaultSender, *app.TransportId)\n\tif err := cc.Start(ctx); err != nil {\n\t\treturn err\n\t}\n\tmedia := controllers.NewMediaController(conn, g.client.Events, cast.DefaultSender, *app.TransportId)\n\tif err := media.Start(ctx); err != nil {\n\t\treturn err\n\t}\n\n\tmediaItem := controllers.MediaItem{\n\t\tContentId: url.String(),\n\t\tContentType: \"audio/mp3\",\n\t\tStreamType: \"BUFFERED\",\n\t}\n\n\tlog.Printf(\"[INFO] Load media: content_id=%s\", mediaItem.ContentId)\n\t_, err = media.LoadMedia(ctx, mediaItem, 0, true, nil)\n\n\treturn err\n}",
"func (d *Demo) Play() {\n\t//Steam isn't in PATH on windows systems, have to specify steam path\n\tcmd := exec.Command(\"steam\", \"-applaunch\", \"440\", \"+playdemo\", d.PathInTFFolder())\n\tif runtime.GOOS == \"windows\" {\n\t\tcmd = exec.Command(\"cmd\", \"/c\", \"start\", \"\", `C:\\Program Files (x86)\\Steam\\Steam.exe`,\n\t\t\t\"-applaunch\", \"440\", \"+playdemo\", d.PathInTFFolder())\n\t}\n\tcmd.Start()\n}",
"func playAzan(azanFile string) {\n\tcmd := exec.Command(\"mpg123\", azanFile)\n\terr := cmd.Run()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n}",
"func (c *Sound) Play(times int) {\n\t// if err := c.resource.GetResource().Play(times); err != nil {\n\tif sound, format := c.resource.GetResource(); sound != nil {\n\t\tif format == engosdl.SoundMP3 {\n\t\t\tif err := sound.(*mix.Music).FadeIn(times, 2500); err != nil {\n\t\t\t\tengosdl.Logger.Error().Err(err).Msg(\"play mix MP3 resource error\")\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t} else if format == engosdl.SoundWAV {\n\t\t\tif _, err := sound.(*mix.Chunk).Play(1, 1); err != nil {\n\t\t\t\tengosdl.Logger.Error().Err(err).Msg(\"play mix WAV resource error\")\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t}\n}",
"func (s *Server) PlayNow(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tuidStr, ufound := vars[\"uid\"]\n\tpidStr, pfound := vars[\"pid\"]\n\tsidStr, sfound := vars[\"sid\"]\n\n\tif !ufound || !pfound || !sfound {\n\t\turlerror(w)\n\t\treturn\n\t}\n\n\tp, err := s.pm.Party(PartyUUID(pidStr))\n\tif err != nil {\n\t\terrMsg := jsonError(\"no such party\")\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tw.Write(errMsg)\n\n\t\treturn\n\t}\n\n\t// try to play the song\n\terr = p.PlayNow(party.UserUUID(uidStr), party.SongUID(sidStr))\n\tif err != nil {\n\t\terrMsg := jsonError(\"%s\", err.Error())\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tw.Write(errMsg)\n\t}\n\n\t// exit with OK status code\n}",
"func (j Jibi) Play() {\n\tj.RunCommand(CmdPlay, nil)\n}",
"func playCurrentSamples(samplePaths []string) {\n for _, samplePath := range samplePaths {\n go playback.PlayFile(samplePath)\n }\n}",
"func (b *Beeper) PlaySound(ctx context.Context, e pipanel.SoundEvent) error {\n\tif err := validateAudioFilename(e.Sound); err != nil {\n\t\treturn errors.Wrap(err, \"bad filename\")\n\t}\n\n\tpathToFile := b.cfg.LibraryPath + e.Sound + \".wav\"\n\n\tf, err := os.Open(pathToFile)\n\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"file not found: %s\", pathToFile)\n\t}\n\n\tstreamer, format, err := wav.Decode(f)\n\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"could not decode WAV audio\")\n\t}\n\n\tvar streamToPlay beep.Streamer = streamer\n\n\tif format.SampleRate != SampleRate {\n\t\tstreamToPlay = beep.Resample(4, format.SampleRate, SampleRate, streamer)\n\t}\n\n\tspeaker.Play(streamToPlay)\n\tb.log.WithContext(ctx).Printf(\"Playing sound: %s\", pathToFile)\n\n\treturn nil\n}",
"func (phone *Ph0n3) play(freq float64, duration time.Duration, wg *sync.WaitGroup) {\n\tdefer func() {\n\t\tif wg != nil {\n\t\t\twg.Done()\n\t\t}\n\t}()\n\tp := phone.ctx.NewPlayer()\n\ts := newSineWave(freq, duration, phone.opt.Channel)\n\tif _, err := io.Copy(p, s); err != nil {\n\t\tlog.Printf(\"%v\", err)\n\t\treturn\n\t}\n\tif err := p.Close(); err != nil {\n\t\tlog.Printf(\"%v\", err)\n\t\treturn\n\t}\n\treturn\n}",
"func (tr *trooper) play(sound uint32) { tr.part.PlaySound(sound) }",
"func play(w http.ResponseWriter, r *http.Request, token string) {\n\tdefer fmt.Println(\"---\")\n\n\tfmt.Println(\"play method:\", r.Method) // get request method\n\n\tfmt.Println(\"play token:\", token)\n\tif token == \"\" {\n\t\thttp.Error(w, \"no token in play\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tplayer, ok := players[token]\n\tif !ok {\n\t\thttp.Error(w, \"no player for token \"+token, http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tfmt.Println(player)\n\terr := playTmpl.Execute(w, player)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t}\n}",
"func (player *Player) Play() {\n\tplayer.obj.Call(\"org.mpris.MediaPlayer2.Player.Play\", 0)\n}",
"func (firstWinGame) Play(player1, _ pig.Player) pig.Player {\n\treturn player1\n}",
"func Play(localmid string) error {\n\treturn fmt.Errorf(\"Sorry, cliaoke is only supported on linux and darwin, consider making a PR for what I can only imagine is openbsd or windows. Clippy says DO IT!\")\n}",
"func (c *Client) PlayHold(path string) error {\n\tfh, err := os.Open(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer fh.Close()\n\n\tbytes, err := ioutil.ReadAll(fh)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Play the loop in separate threads\n\tch := make(chan int16)\n\tgo c.Mumble.StreamAudio(ch)\n\tgo c.loopRaw(ch, bytes)\n\treturn nil\n}",
"func (c *Client) Play(guildID string, trackID string, options ...play.Option) error {\n\tp := play.New(guildID, trackID)\n\n\tfor _, option := range options {\n\t\tif err := option(p); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn c.send(p)\n}",
"func PlaySong(ctx framework.Context) {\n\n\targs := strings.Join(ctx.Args, \" \")\n\n\t// Resume playing if no args\n\tif args == \"\" {\n\t\tif !ctx.MediaPlayer.IsConnected {\n\t\t\tif len(ctx.MediaPlayer.Queue) == 0 {\n\t\t\t\tctx.ReplyEmbed(\"Oops!\", \"No song to play!\", 0xEB5160)\n\t\t\t} else {\n\t\t\t\tctx.MediaPlayer.StartPlaying(ctx.Discord, ctx.Guild, ctx.Message.Author.ID)\n\t\t\t}\n\t\t} else if err := CheckSameChannel(ctx); err != nil {\n\t\t\tlog.Println(err)\n\t\t} else if err := ctx.MediaPlayer.Resume(); err != nil {\n\t\t\tctx.ReplyEmbed(\"Oops!\", \"No song to play!\", 0xEB5160)\n\t\t}\n\n\t\treturn\n\t}\n\n\t// Get song details\n\tvar song framework.Song\n\tsong.Id, song.Title, song.Duration = GetMetaData(args)\n\n\tif song.Id == \"\" {\n\t\tctx.ReplyEmbed(\"Oops!\", args+\" not found\", 0xEB5160)\n\t\treturn\n\t}\n\n\t// Check if duration is too long\n\tif d, err := time.ParseDuration(song.Duration); err != nil {\n\t\tctx.ReplyEmbed(\"Oops!\", \"Encountered an error\", 0xEB5160)\n\t\treturn\n\t} else {\n\t\tlmt, _ := time.ParseDuration(\"1h\")\n\n\t\tif d > lmt {\n\t\t\tctx.ReplyEmbed(\"Oops!\", \"Song length too long\", 0xEB5160)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Check if song present locally\n\t_, ok := ctx.SongIdList.IdList[song.Id]\n\tif !ok {\n\t\t// Get the song in dca format\n\t\tif err := GetSong(song.Id); err != nil {\n\t\t\tlog.Println(\"PlaySong(): \" + err.Error())\n\t\t\tctx.ReplyEmbed(\"Oops!\", err.Error(), 0xEB5160)\n\t\t\treturn\n\t\t}\n\n\t\t// Update song in program and file system\n\t\tif err := ctx.SongIdList.UpdateSongs(song); err != nil {\n\t\t\tlog.Println(\"PlaySong(): \" + err.Error())\n\t\t\tctx.ReplyEmbed(\"Oops!\", \"Unable to load song\", 0xEB5160)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Add song to queue\n\tctx.MediaPlayer.AddSongs(song)\n\n\t// start the player if its not running\n\tif !ctx.MediaPlayer.IsConnected {\n\t\tgo ctx.MediaPlayer.StartPlaying(ctx.Discord, ctx.Guild, ctx.Message.Author.ID)\n\t} else if ctx.MediaPlayer.IsPaused {\n\t\tctx.MediaPlayer.Resume()\n\t}\n\n\tctx.ReplyEmbed(song.Title+\" queued!\", \"\", 0xFFD900)\n}",
"func playSound(s *discord.Session, guildID, channelID, videoURL string) (err error) {\n\t// Join the provided voice channel.\n\tvc, err := s.ChannelVoiceJoin(guildID, channelID, false, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\twithSpeaking := func() error { return stream(vc, videoURL) }\n\twithSleepFn := func() error { return wrapWithSpeaking(withSpeaking, vc) }\n\tf := func() error { return wrapWithSleep(withSleepFn, 250*time.Millisecond, 250*time.Millisecond, false) }\n\n\t// Call the payload.\n\terr1 := f()\n\n\t// Disconnect from the provided voice channel.\n\tif err := vc.Disconnect(); err != nil && err1 == nil {\n\t\treturn err\n\t}\n\treturn err1\n}",
"func (t Track) Play() {\n\tpanic(\"implement me\")\n}",
"func (o *OMXPlayer) Play() error {\n\tif o.status == statusPlaying {\n\t\treturn nil\n\t}\n\n\t// TODO: test this properly by mocking dbus package.\n\tif o.testing {\n\t\to.status = statusPlaying\n\t\treturn nil\n\t}\n\n\t_, err := o.dbusSend(\"Play\", dbus.FlagNoAutoStart)\n\tif err != nil {\n\t\treturn err\n\t}\n\to.status = statusPlaying\n\treturn nil\n}",
"func playScript(fsys fs.FS, transport string) {\n\tmodTime := time.Now()\n\tvar buf bytes.Buffer\n\tfor _, p := range scripts {\n\t\tb, err := fs.ReadFile(fsys, \"static/\"+p)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuf.Write(b)\n\t}\n\tfmt.Fprintf(&buf, \"\\ninitPlayground(new %v());\\n\", transport)\n\tb := buf.Bytes()\n\thttp.HandleFunc(\"/play.js\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-type\", \"application/javascript\")\n\t\thttp.ServeContent(w, r, \"\", modTime, bytes.NewReader(b))\n\t})\n}",
"func (e *Engine) PlayWAV(chunk *mix.Chunk) {\n\tchunk.Play(-1, 0)\n}",
"func (p *Player) play(t *perceptor.Track) error {\n\t// Reset Pause State\n\tPAUSE_DURATION = 0\n\tPAUSE_START = time.Time{}\n\n\t// Get the track\n\ttrack, err := p.loadTrack(t.Uri)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Load the Track\n\tlog.Info(\"Load Track into Player\")\n\tif err := p.player.Load(track); err != nil {\n\t\treturn err\n\t}\n\n\t// Defer unloading the track until we exit this func\n\tdefer p.player.Unload()\n\n\t// Send play event to perspector - go routine so we don't block\n\tgo func() {\n\t\tp.pcptr.Play(t, time.Now().UTC())\n\t\treturn\n\t}()\n\n\t// Play the track\n\tlog.Println(fmt.Sprintf(\"Playing: %s\", t.Uri))\n\tp.player.Play() // This does NOT block, we must block ourselves\n\n\t// Go routine to listen for end of track updates from the player, once we get one\n\t// send a message to our own StopTrack channel\n\tgo func() {\n\t\t<-p.session.EndOfTrackUpdates() // Blocks\n\t\tlog.Debug(\"End of Track Updates\")\n\t\tp.channels.Stop <- true\n\t\treturn\n\t}()\n\n\t<-p.channels.Stop // Blocks\n\tlog.Infof(fmt.Sprintf(\"Track stopped: %s\", t.Uri))\n\n\treturn nil\n}",
"func (n *noise) Play(index int) {\n\tif n.loaded && index >= 0 && index < len(n.snds) {\n\t\tsnd := n.snds[index]\n\t\tif p, ok := n.eng.povs[n.eid]; ok {\n\t\t\tx, y, z := p.Location()\n\t\t\tgo func(sid uint64, x, y, z float64) {\n\t\t\t\tn.eng.machine <- &playSound{sid: sid, x: x, y: y, z: z}\n\t\t\t}(snd.sid, x, y, z)\n\t\t}\n\t}\n}",
"func send_mp3_file(song_file string, client int) {\n\tdefer syscall.Close(client)\n\tbytes, err := ioutil.ReadFile(\"songs/\" + song_file)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tsyscall.Write(client, bytes)\n}",
"func (f *File) Play() error {\n\t// initialize the underlying APIs for audio transmission\n\tportaudio.Initialize()\n\tdefer portaudio.Terminate()\n\n\t// create a buffer for audio to be put into\n\t// hardcode 16-bit sample until i figure out a better way to do this\n\tbufLen := int(BufSize * f.AudioData.NumChannels)\n\tbuf := make([]int16, bufLen)\n\n\t// create the audio stream to write to\n\tstream, err := portaudio.OpenDefaultStream(0, int(f.AudioData.NumChannels), float64(f.AudioData.SampleRate), BufSize, buf)\n\tif err != nil {\n\t\treturn errors.NewFromErrorCodeInfo(errors.AudioFileOutputStreamNotOpened, err.Error())\n\t}\n\tdefer stream.Close()\n\tdefer stream.Stop()\n\tstream.Start()\n\n\t// get audio data (without WAV header)\n\tdata := f.AudioData.AudioData()\n\tstep := bufLen * 2 // *2 since we need twice as many bytes to fill up `bufLen` in16s\n\n\tf.playing = true\n\tdefer func() { f.playing = false }()\n\n\tfor i := 0; i < len(data); i += step {\n\t\t// check if we should stop (user called f.Stop())\n\t\tif f.shouldStop {\n\t\t\tf.shouldStop = false\n\t\t\tbreak\n\t\t}\n\t\t// need to convert each 2-bytes in [i, i+step] to 1 little endian int16\n\t\tfor j := 0; j < bufLen; j++ {\n\t\t\tk := j * 2\n\t\t\tbuf[j] = int16(binary.LittleEndian.Uint16(data[i+k : i+k+2]))\n\t\t}\n\t\t// write the converted data into the stream\n\t\terr := stream.Write()\n\t\tif err != nil {\n\t\t\treturn errors.NewFromErrorCodeInfo(errors.AudioFileNotWritableStream, err.Error())\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (s *Service) PlaySong() {\n\tfor {\n\t\tselect {\n\t\tcase <-s.playChan:\n\t\t\tfor len(s.queue) > 0 {\n\t\t\t\ts.cmd = exec.Command(\"mpv\", \"--no-terminal\", \"--no-video\", s.queue[0])\n\t\t\t\ts.cmd.Run()\n\t\t\t\ts.queue.pop()\n\t\t\t}\n\t\t}\n\t}\n}",
"func (d *defaultMusicPlayer) PlayMusic(input chan []byte, guildID string, vc Channel, mainPlaylist bool) {\n\tif !vc.ExistsNext() && mainPlaylist {\n\t\tpanic(\"Song does not exist in playlist but PlayMusic was called.\")\n\t} else if !vc.ExistsBackupNext() && !mainPlaylist {\n\t\tpanic(\"Song does not exist in backup playlist but PlayMusic was called.\")\n\t}\n\n\tvar song *playlist.Song\n\tvar aborted bool\n\n\tif mainPlaylist {\n\t\tsong = vc.GetNext()\n\t} else {\n\t\tsong = vc.GetBackupNext()\n\t}\n\n\tdefer func() {\n\t\tif aborted {\n\t\t\treturn\n\t\t}\n\n\t\tvc.RemoveNowPlaying()\n\n\t\tif vc.ExistsNext() {\n\t\t\tgo d.PlayMusic(input, guildID, vc, true)\n\t\t} else if vc.ExistsBackupNext() {\n\t\t\tgo d.PlayMusic(input, guildID, vc, false)\n\t\t}\n\t}()\n\n\tencodeSession, err := dca.EncodeFile(ytmp3.PathToAudio(song.YoutubeID), dca.StdEncodeOptions)\n\tif err != nil {\n\t\tlog.Print(err)\n\t\treturn\n\t}\n\tdefer encodeSession.Cleanup()\n\n\tdecoder := dca.NewDecoder(encodeSession)\n\tabortChannel := ActiveVoiceChannels[guildID].GetAbortChannel()\n\n\tfor {\n\t\tframe, err := decoder.OpusFrame()\n\t\tif err != nil {\n\t\t\tif err != io.EOF {\n\t\t\t\tlog.Print(err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\t// Do something with the frame, in this example were sending it to discord\n\t\tselect {\n\t\tcase input <- frame:\n\t\tcase <-abortChannel:\n\t\t\taborted = true\n\t\t\treturn\n\t\tcase <-time.After(time.Second):\n\t\t\t// We haven't been able to send a frame in a second, assume the connection is borked\n\t\t\tlog.Println(\"TIMEOUT: Unable to send audio..\")\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}",
"func playSound(s *discordgo.Session, guildID, channelID string) (err error) {\n\n\t// Join the provided voice channel.\n\tvc, err := s.ChannelVoiceJoin(guildID, channelID, false, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Sleep for a specified amount of time before playing the sound\n\ttime.Sleep(250 * time.Millisecond)\n\n\t// Start speaking.\n\tvc.Speaking(true)\n\t\n\t// Send the buffer data.\n\tfor _, buff := range buffer {\n\t\tvc.OpusSend <- buff\n\t}\n\n\t// Stop speaking\n\tvc.Speaking(false)\n\n\t// Sleep for a specificed amount of time before ending.\n\ttime.Sleep(250 * time.Millisecond)\n\n\t// Disconnect from the provided voice channel.\n\tvc.Disconnect()\n\n\treturn nil\n}",
"func (a *HipchatAdapter) Play(res *Response, strings ...string) error {\n\treturn nil\n}",
"func (player *AudioPlayer) PlayText(text string) {\n\tspeech := htgotts.Speech{Folder: player.AudioFolder, Language: player.Language}\n\tspeech.Speak(text)\n}",
"func (p *Player) Play() error {\n\tif p.player == nil {\n\t\treturn errors.New(\"player must be initialized first\")\n\t}\n\tif p.IsPlaying() {\n\t\treturn nil\n\t}\n\n\tif C.libvlc_media_player_play(p.player) < 0 {\n\t\treturn getError()\n\t}\n\n\treturn nil\n}",
"func PlaybackFileCommand(ctx context.Context, file string, duration, channels, rate int) *testexec.Cmd {\n\treturn crasTestClientCommand(ctx, playbackMode, file, duration, channels, blockSize(rate), rate)\n}",
"func PlayInstant(in input.FileReader, action func(string, []byte)) {\n\tvar wg sync.WaitGroup\n\tvar i uint64 = 0\n\n\tfor {\n\t\td, e := in.ReadLine()\n\t\tif e == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif e != nil {\n\t\t\tutil.Fatal(e)\n\t\t\treturn\n\t\t}\n\n\t\twg.Add(1)\n\t\ti++\n\t\tgo func(i uint64, d []byte) {\n\t\t\taction(fmt.Sprintf(\"no=%d\", i), d)\n\t\t\twg.Done()\n\t\t}(i, d)\n\t}\n\twg.Wait()\n}",
"func TestLoadMp3(t *testing.T) {\n\t_, err := LoadFile(\"mp3/test.mp3\")\n\tassert.Nil(t, err)\n}",
"func (c Client) Play() error {\n\terr := c.authenticateUser()\n\tif err != nil {\n\t\tfmt.Fprintf(c.Output, \"unexpected error authenticating user: %v\", err)\n\t\tos.Exit(1)\n\t}\n\n\treturn c.handleGameIO()\n}",
"func (player *musicPlayer) playQueue(trim float64, ch chan error) {\n\tplayer.playQueueMutex.Lock()\n\tdefer player.playQueueMutex.Unlock()\n\tplay := true\n\tfirst := true\n\tplayer.Lock()\n\tplayer.state.status = waiting\n\tplayer.Unlock()\n\tfor play {\n\t\tvar fileName string\n\t\tplayer.Lock()\n\t\tif player.state.status == paused {\n\t\t\tplay = false\n\t\t} else {\n\t\t\tindex := player.state.current\n\t\t\tif index < len(player.state.queue) {\n\t\t\t\tfileName = player.state.queue[index]\n\t\t\t} else {\n\t\t\t\tplay = false\n\t\t\t\tplayer.state.current = 0\n\t\t\t\tplayer.state.status = waiting\n\t\t\t}\n\t\t}\n\t\tplayer.Unlock()\n\n\t\tif play && len(fileName) > 0 {\n\t\t\tfmt.Println(\"play queue - song to be played \", fileName)\n\t\t\tif first {\n\t\t\t\tfirst = false\n\t\t\t\tplayer.playSingleFile(fileName, trim, ch)\n\t\t\t} else {\n\t\t\t\tplayer.playSingleFile(fileName, trim, nil)\n\t\t\t}\n\t\t\ttrim = 0\n\n\t\t\tplayer.Lock()\n\t\t\tif player.state.status == waiting {\n\t\t\t\tplayer.state.current += 1\n\t\t\t}\n\t\t\tplayer.Unlock()\n\t\t}\n\t}\n}",
"func (cr *Playback) Play() gin.HandlerFunc {\n\treturn func(c *gin.Context) {\n\t\tcurrentParty, err := session.CurrentParty(c)\n\t\tif err != nil {\n\t\t\tif err != sql.ErrNoRows {\n\t\t\t\tc.Error(e.Internal.CausedBy(err))\n\t\t\t\tc.Abort()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tc.Error(e.NotFound.WithMessage(\"Host has not started a party\"))\n\t\t\tc.Abort()\n\t\t\treturn\n\t\t}\n\n\t\tvar currentTrack models.PlayingTrack\n\t\tif !currentParty.CurrentTrack.Valid {\n\t\t\t// Begin playing the party's queue\n\t\t\tshuffleParam := c.Query(\"shuffle\")\n\t\t\tshuffle := shuffleParam != \"\" && shuffleParam != \"no\" && shuffleParam != \"0\"\n\n\t\t\tqueue, err := currentParty.QueueTracks()\n\t\t\tif err != nil {\n\t\t\t\tc.Error(e.Internal.CausedBy(err))\n\t\t\t\tc.Abort()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Shuffle the queue if requested\n\t\t\tif shuffle {\n\t\t\t\tqueue = models.Shuffle(queue)\n\t\t\t}\n\n\t\t\ttrack, err := cr.popTrackAndPlay(queue, currentParty.QueueID, currentParty.RoomCode)\n\t\t\tif err != nil {\n\t\t\t\tc.Error(e.Internal.CausedBy(err))\n\t\t\t\tc.Abort()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcurrentTrack = *track\n\t\t} else {\n\t\t\t// Resume the current track\n\t\t\terr = currentParty.CurrentTrack.Unmarshal(currentTrack)\n\t\t\tif err != nil {\n\t\t\t\tc.Error(e.Internal.CausedBy(err))\n\t\t\t\tc.Abort()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// It is a bad request to resume a track that is already playing\n\t\t\tif !currentTrack.Paused {\n\t\t\t\tc.Error(e.BadRequest.WithDetail(\"Current track is not paused\"))\n\t\t\t\tc.Abort()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentTrack.BeganPlaying = time.Now().UTC().Add(\n\t\t\t\ttime.Duration(currentTrack.Elapsed) * time.Second * -1,\n\t\t\t)\n\t\t}\n\n\t\tcurrentTrack.Paused = false\n\n\t\terr = cr.updateTrackAndBroadcast(currentParty, ¤tTrack)\n\t\tif err != nil {\n\t\t\tc.Error(e.Internal.CausedBy(err))\n\t\t\tc.Abort()\n\t\t\treturn\n\t\t}\n\n\t\tc.JSON(http.StatusOK, models.EmptyRespose)\n\t}\n}",
"func playSound(s *discordgo.Session, guildID, channelID string) (err error) {\n\n\t// Join the provided voice channel.\n\tvc, err := s.ChannelVoiceJoin(guildID, channelID, false, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Sleep for a specified amount of time before playing the sound\n\ttime.Sleep(250 * time.Millisecond)\n\n\t// Start speaking.\n\tvc.Speaking(true)\n\tkey := guildID + \":\" + channelID\n\tstopCh := make(chan int)\n\tstopMutex.Lock()\n\tstop[key] = &stopCh\n\tstopMutex.Unlock()\n\t// Send the buffer data.\n\tfunc() {\n\t\tfor _, buff := range buffer {\n\t\t\tselect {\n\t\t\tcase <-stopCh:\n\t\t\t\treturn\n\t\t\tdefault:\n\t\t\t\tvc.OpusSend <- buff\n\t\t\t}\n\t\t}\n\t}()\n\tclose(stopCh)\n\tdelete(stop, key)\n\n\t// Stop speaking\n\tvc.Speaking(false)\n\n\t// Sleep for a specificed amount of time before ending.\n\ttime.Sleep(250 * time.Millisecond)\n\n\t// Disconnect from the provided voice channel.\n\tvc.Disconnect()\n\n\treturn nil\n}",
"func (c *Chrome) Play() error {\n\tmsg := wsMessage{\n\t\tComponent: \"player\",\n\t\tMethod: \"play\",\n\t}\n\n\t// TODO: create convenience method that sends and waits?\n\tsend := c.ConnViewer.getChanSend()\n\tsend <- msg\n\t// Wait for response\n\tres := <-c.ConnViewer.getChanReceive()\n\treturn handleRes(res)\n}",
"func (omx OmxPlayer) CanPlay(path string) bool {\n\tif omx.supportedTypes.Match([]byte(path)) {\n\t\treturn true\n\t}\n\treturn false\n}",
"func (player *musicPlayer) play(playItem string) ([]string, error) {\n\tplayer.Lock()\n\n\tplayer.stopFlow()\n\tplayer.state.queue = make([]string, 0)\n\tplayer.state.current = 0\n\n\titems, err := player.addPlayItem(playItem)\n\tplayer.Unlock()\n\n\t// play all items\n\tch := make(chan error)\n\tdefer close(ch)\n\tif err == nil {\n\t\tgo player.playQueue(0, ch)\n\t\terr = <-ch\n\t}\n\treturn items, err\n}",
"func (p *Pet) Play() {\n\tfmt.Println(p.Speak())\n}",
"func player(ch chan say.VoicePart, counter int, debug bool) {\n\n\tfor i := 0; i < counter; i++ {\n\t\tvp := <-ch\n\t\tif debug {\n\t\t\tfmt.Printf(\"Index: %d\\nMessage: %s\\nFileName: %s\\n\",\n\t\t\t\tvp.Index, vp.Message, vp.FileName)\n\t\t\tfmt.Println(\"---------------------------\")\n\t\t}\n\t\ttmux := exec.Command(\"mpg123\", vp.FileName)\n\t\ttmux.Run()\n\t}\n}",
"func (r *Radio) Play(b *dream.Session, vc *discordgo.VoiceConnection) (*dream.AudioDispatcher, error) {\n\tsong, err := r.Queue.Song()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar stream io.ReadCloser\n\n\tif r.UseYoutubeDL {\n\t\tyt := exec.Command(\"youtube-dl\", \"-f\", \"bestaudio\", \"--youtube-skip-dash-manifest\", \"-o\", \"-\", song.URL)\n\t\tstream, err = yt.StdoutPipe()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\terr = yt.Start()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tstream, err = util.YoutubeDL(song.URL)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tdisp := b.PlayStream(vc, stream)\n\treturn disp, nil\n}",
"func (self Sound) Play() { \n C.sfSound_play(self.Cref);\n}",
"func mp3File(t Tags) string {\n\tfqp := path.Join(Homedir(), \"Music\", \"audio\", hierarchy(t)) + \".mp3\"\n\tlog.Printf(\"Using mp3 file %s\\n\", fqp)\n\treturn fqp\n}",
"func (s *Sound) PlayFromStart() {\n\ts.snd.Set(\"currentTime\", 0)\n\ts.snd.Call(\"play\")\n}",
"func (p player) Play(ctx context.Context, b tictactoe.Board, mark tictactoe.State) (tictactoe.Move, error) {\n\t// Outsource our decision-making process to the human.\n\t// They know what they're doing. Hopefully.\n\treturn <-p.chosenMove, nil\n}",
"func playSound(playCmd playCommand) ([][]byte, error) {\n\tval, ok := checkCache(playCmd.name)\n\tif ok {\n\t\treturn val, nil\n\t}\n\n\tvar opusData []byte\n\tif s3Persistence == \"true\" {\n\t\topusData = getSoundS3(playCmd.name)\n\t} else {\n\t\topusData = getSoundLocal(playCmd.name)\n\t}\n\n\tdecodedFrames := gobDecodeOpusFrames(opusData)\n\tputCache(playCmd.name, decodedFrames)\n\treturn decodedFrames, nil\n}",
"func (a *AudioLog) PlaySound(e pipanel.SoundEvent) error {\n\ta.log.Printf(\n\t\t\"## SOUND EVENT ##\\n\"+\n\t\t\t\"Sound: %s\\n\",\n\t\te.Sound)\n\n\treturn nil\n}",
"func (f *File) Stop() {\n\tif f.playing {\n\t\tf.shouldStop = true\n\t}\n}",
"func NewFilePlayer() (player FilePlayer, err error) {\n\treturn\n}",
"func (p *Player) Run() {\n\tfor {\n\t\ttrack, err := p.pcptr.Next()\n\t\tif err != nil {\n\t\t\tlog.Infof(\"Failed to Get Track: %s\", err)\n\t\t\t<-p.channels.CheckNext // Block until we have a next track\n\t\t\tcontinue\n\t\t}\n\t\tp.play(track) // Blocks\n\t\tp.pcptr.End(track) // Publish end event\n\t}\n}",
"func (t *AudioPlayer) Start(a *app.App) {\n\n\tvar err error\n\tt.pc1, err = NewPlayerControl(a, \"bomb1.wav\")\n\tt.pc1.player.SetLooping(false)\n\tif err != nil {\n\t\ta.Log().Fatal(\"%s\", err)\n\t}\n\tt.pc1.SetPosition(40, 10)\n\ta.DemoPanel().Add(t.pc1)\n\n\tt.pc2, err = NewPlayerControl(a, \"Vivaldi1.wav\")\n\tif err != nil {\n\t\ta.Log().Fatal(\"%s\", err)\n\t}\n\tt.pc2.SetPosition(40, t.pc1.Position().Y+t.pc1.Height()+20)\n\ta.DemoPanel().Add(t.pc2)\n\n\tt.pc3, err = NewPlayerControl(a, \"bomb2.ogg\")\n\tt.pc3.player.SetLooping(false)\n\tif err != nil {\n\t\ta.Log().Fatal(\"%s\", err)\n\t}\n\tt.pc3.SetPosition(40, t.pc2.Position().Y+t.pc2.Height()+40)\n\ta.DemoPanel().Add(t.pc3)\n\n\tt.pc4, err = NewPlayerControl(a, \"Bach1.ogg\")\n\tif err != nil {\n\t\ta.Log().Fatal(\"%s\", err)\n\t}\n\tt.pc4.SetPosition(40, t.pc3.Position().Y+t.pc3.Height()+20)\n\ta.DemoPanel().Add(t.pc4)\n}",
"func ImportPlay(path string) (*Play, error) {\n var play Play\n err := ImportComponent(path, &play)\n return &play, err\n}",
"func Play() {\r\n\t\r\n\tvar g Game\r\n\tg.initialize()\r\n\r\n\tfor !g.finished() {\r\n\t\tg.nextRound()\r\n\t}\r\n}",
"func (c *Client) playRaw(bytes []byte) {\n\t// Decode and adjust audio\n\tvolume := MaxVolume - c.Volume()\n\tsamples := make([]int16, len(bytes)/2)\n\tfor i := range samples {\n\t\tsamples[i] = int16(binary.LittleEndian.Uint16(bytes[i*2:i*2+2])) >> volume\n\t}\n\n\t// Play the audio\n\tc.Mumble.SendAudio(samples)\n}",
"func (ap *AudioPlayer) Play(done chan bool) {\n\tap.playCh <- apPlayRequest{done}\n}",
"func PlayPaced(in input.FileReader, action func(string, []byte), del time.Duration, mjMSec int) {\n\tvar wg sync.WaitGroup\n\tvar i uint64 = 0\n\n\tlog.Printf(\"Base delay between messages is %s with max jitter %s\",\n\t\tdel, util.MSecToDuration(mjMSec))\n\n\tfor {\n\t\td, e := in.ReadLine()\n\t\tif e == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif e != nil {\n\t\t\tutil.Fatal(e)\n\t\t\treturn\n\t\t}\n\n\t\twg.Add(1)\n\t\ti++\n\t\tgo func(i uint64, d []byte) {\n\t\t\taction(fmt.Sprintf(\"no=%d\", i), d)\n\t\t\twg.Done()\n\t\t}(i, d)\n\n\t\tjitter := util.Jitter(mjMSec)\n\t\ttime.Sleep(time.Duration(jitter.Nanoseconds() + del.Nanoseconds()))\n\t}\n\twg.Wait()\n}",
"func (s *playSession) playSequence(ctx context.Context, p ari.Player, playbackCounter int) {\n\tseq := newSequence(s)\n\n\ts.mu.Lock()\n\ts.currentSequence = seq\n\ts.mu.Unlock()\n\n\tgo seq.Play(ctx, p, playbackCounter)\n\n\t// Wait for sequence playback to complete (or context closure to be caught)\n\tselect {\n\tcase <-ctx.Done():\n\tcase <-seq.Done():\n\t\tif s.result.Status == InProgress {\n\t\t\ts.result.Status = Finished\n\t\t}\n\t}\n\n\t// Stop audio playback if it is still running\n\tseq.Stop()\n\n\t// wait for cleanup of sequence so we can get the proper error result\n\t<-seq.Done()\n}",
"func play(freq float64, duration time.Duration) oto.Player {\n\ts := newSineWave(freq, duration)\n\tp := context.NewPlayer(s)\n\tp.Play()\n\treturn p\n}",
"func PlayFromURL(token *string, uri string) (err error) {\n\turiKind := strings.Split(uri, \":\")[1]\n\tvar values []byte\n\tif uriKind == track {\n\t\tvalues, err = json.Marshal(playJSON{URIs: []string{uri}})\n\t} else {\n\t\tvalues, err = json.Marshal(playListJSON{ContextURI: uri})\n\t}\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = CreateRequest(token, requesttypes.PUT, \"/me/player/play\", bytes.NewBuffer(values))\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn\n}",
"func Process(plyr Player) {\n\tlogPlayInfo(plyr)\n\tplyr.Play()\n\tplyr.Stop()\n}",
"func AudioFromFile(ctx context.Context, audioFilePath string) error {\n\taudioInput := audio.TestRawData{\n\t\tPath: audioFilePath,\n\t\tBitsPerSample: 16,\n\t\tChannels: 2,\n\t\tRate: 48000,\n\t\tFrequencies: []int{440, 440},\n\t\tVolume: 0.05,\n\t}\n\n\t// Playback function by CRAS.\n\tplayCmd := crastestclient.PlaybackFileCommand(\n\t\tctx, audioInput.Path,\n\t\taudioInput.Duration,\n\t\taudioInput.Channels,\n\t\taudioInput.Rate)\n\tplayCmd.Start()\n\n\treturn nil\n}",
"func Next() string {\n\n\t_, err := os.Stat(\"/dev/shm/goicy/next.mp3\")\n\n\tif os.IsNotExist(err) {\n\t\t//file does not exist\n\t\t//buffer the next file\n\t\tsaveNext()\n\t} else if err != nil {\n\t\tlogger.Log(\"Unknown file error \"+err.Error(), logger.LOG_INFO)\n\t}\n\t//move the file from next to current\n\t//buffer the next file\n\tos.Rename(\"/dev/shm/goicy/next.mp3\", \"/dev/shm/goicy/current.mp3\")\n\tappendHistory(pl.NextTrack)\n\tgo saveNext()\n\treturn \"/dev/shm/goicy/current.mp3\"\n}",
"func (c *Client) PlayGPX(filename string) error {\n\tdat, err := os.ReadFile(filename)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to read gpx file %s: %v\", filename, err)\n\t}\n\n\tvar gpx Gpx\n\tif err := xml.Unmarshal(dat, &gpx); err != nil {\n\t\treturn fmt.Errorf(\"failed to parse gpx file %s: %v\", filename, err)\n\t}\n\n\tvar lastPointTime time.Time\n\tfor _, trk := range gpx.Tracks {\n\t\tfor _, seg := range trk.TrackSegments {\n\t\t\tfor _, pt := range seg.TrackPoints {\n\t\t\t\tcurrentPointTime, err := time.Parse(time.RFC3339, pt.PointTime)\n\n\t\t\t\tif !lastPointTime.IsZero() {\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\n\t\t\t\t\tduration := currentPointTime.Unix() - lastPointTime.Unix()\n\n\t\t\t\t\tif duration > 0 {\n\t\t\t\t\t\ttime.Sleep(time.Duration(duration) * time.Second)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlastPointTime = currentPointTime\n\n\t\t\t\tif err := c.Set(pt.PointLatitude, pt.PointLongitude); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}",
"func Play(w http.ResponseWriter, r *http.Request) {\n\tfmt.Println(\"Received Request: /MediaControls\")\n\taction := strings.TrimPrefix(r.URL.Path, \"/MediaControls/\")\n\tfmt.Println(\"Action:\", action)\n\n\tvar URL *url.URL\n\tURL, err := url.Parse(\"https://api.spotify.com\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tURL.Path += \"/v1/me/player/play\"\n\n\tclient := &http.Client{}\n\treq := &http.Request{}\n\n\tif sPlayerContext != sCurrentPlaylist.PlaylistURI {\n\t\treqBody := map[string]interface{}{\n\t\t\t\"context_uri\": sCurrentPlaylist.PlaylistURI,\n\t\t}\n\t\tbytesRepresentation, err := json.Marshal(reqBody)\n\t\tif err != nil {\n\t\t\tlog.Fatalln(err)\n\t\t}\n\t\treq, err = http.NewRequest(\"PUT\", URL.String(), bytes.NewBuffer(bytesRepresentation))\n\t\tsPlayerContext = sCurrentPlaylist.PlaylistURI\n\t} else {\n\t\treq, err = http.NewRequest(\"PUT\", URL.String(), nil)\n\t}\n\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"Authorization\", \"Bearer \"+sAcsTok.AccessToken)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t_, err = client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n}",
"func click_sound() {\n\tvar errA error\n\tmpv_cmd := fmt.Sprintf(\"mpv --really-quiet audio/click.wav\")\n\tcmd_run, errA = exec.Command(\"bash\", \"-c\", mpv_cmd).Output()\n\tif errA != nil {\n\t\tfmt.Printf(\"Error playing sound\\n\")\n\t}\n}",
"func (ps *PollySpeaker) GenerateSpeech(s string, fileName string) error {\n\tinput := &polly.SynthesizeSpeechInput{OutputFormat: aws.String(\"mp3\"), Text: aws.String(s), VoiceId: ps.VoiceID}\n\toutput, err := ps.SynthesizeSpeech(input)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tpath, err := ps.saveAsMP3(fileName, output)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := exec.Command(\"afplay\", path).Run(); err != nil {\n\t\treturn err\n\t}\n\n\tif err := os.Remove(path); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}",
"func (player *musicPlayer) next() (string, error) {\n\tplayer.Lock()\n\tvar songToResume string\n\tif player.state.current < len(player.state.queue)-1 {\n\t\tif player.state.status == playing {\n\t\t\tplayer.stopFlow()\n\t\t}\n\t\tplayer.state.current += 1\n\t\tsongToResume = player.state.queue[player.state.current]\n\n\t} else {\n\t\tplayer.Unlock()\n\t\treturn songToResume, errors.New(cannot_next_msg)\n\t}\n\n\tplayer.Unlock()\n\tch := make(chan error)\n\tdefer close(ch)\n\tgo player.playQueue(0, ch)\n\terr := <-ch\n\n\treturn songToResume, err\n}",
"func (p *RandomPlayer) Play(s *State) Action {\n\tfmt.Println(s)\n\tactions := s.Actions()\n\ttime.Sleep(p.Delay * time.Second)\n\ti := rand.Intn(len(actions))\n\tfmt.Printf(\"%s picks %v randomly from %v\\n\", p.Name, actions[i], actions)\n\treturn actions[i]\n}",
"func ripSound(ripCmd ripCommand) error {\n\tvideoBuf, err := fetchVideoData(ripCmd.url)\n\tif err != nil {\n\t\treturn err\n\t}\n\topusFrames, err := convertToOpusFrames(videoBuf, ripCmd.start, ripCmd.duration)\n\tif err != nil {\n\t\treturn err\n\t}\n\tencodedFrames, err := gobEncodeOpusFrames(opusFrames)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif s3Persistence == \"true\" {\n\t\terr = putSoundS3(encodedFrames, ripCmd.name)\n\t} else {\n\t\terr = putSoundLocal(encodedFrames, ripCmd.name)\n\t}\n\treturn err\n}",
"func (p *ComputerPlayer) Play(s *State) Action {\n\tfmt.Println(s)\n\tp.mark = s.Player()\n\treturn p.minimax(s)\n}",
"func ProbeAudioFile(file string) (meta *AudioMeta, err error) {\n\tlog.Debugln(file)\n\text := filepath.Ext(file)\n\tmime := mime.TypeByExtension(ext)\n\tif len(mime) == 0 {\n\t\tvar fh *os.File\n\t\tfh, err = os.Open(file)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tdefer fh.Close()\n\n\t\tb := make([]byte, 512)\n\t\t_, err = fh.Read(b)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\t// Always returns a valid MIME.\n\t\tmime = http.DetectContentType(b)\n\t}\n\n\tmeta = &AudioMeta{}\n\tdone := false\n\tfoundProber := false\n\tfor _, prober := range probers {\n\t\tif prober.Mime.MatchString(mime) {\n\t\t\tfor _, ap := range prober.Probers {\n\t\t\t\tlog.WithFields(log.Fields{\"mime\": mime, \"file\": file}).Debugf(\"Using prober '%s'.\", ap)\n\t\t\t\tfoundProber = true\n\t\t\t\ttmpMeta, err := ap.ProbeAudio(file)\n\t\t\t\tif err != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tmeta.Merge(tmpMeta)\n\t\t\t\tif meta.IsComplete() {\n\t\t\t\t\tdone = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif done {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif !foundProber {\n\t\treturn nil, errors.New(\"No prober found for '\" + mime + \"'\")\n\t}\n\n\treturn\n}",
"func testSingleFileGet(t *testing.T, tg *siatest.TestGroup) {\n\t// Grab the first of the group's renters\n\trenter := tg.Renters()[0]\n\t// Upload file, creating a piece for each host in the group\n\tdataPieces := uint64(1)\n\tparityPieces := uint64(len(tg.Hosts())) - dataPieces\n\tfileSize := 100 + siatest.Fuzz()\n\t_, _, err := renter.UploadNewFileBlocking(fileSize, dataPieces, parityPieces)\n\tif err != nil {\n\t\tt.Fatal(\"Failed to upload a file for testing: \", err)\n\t}\n\n\tfiles, err := renter.Files()\n\tif err != nil {\n\t\tt.Fatal(\"Failed to get renter files: \", err)\n\t}\n\n\tvar file modules.FileInfo\n\tfor _, f := range files {\n\t\tfile, err = renter.File(f.SiaPath)\n\t\tif err != nil {\n\t\t\tt.Fatal(\"Failed to request single file\", err)\n\t\t}\n\t\tif file != f {\n\t\t\tt.Fatal(\"Single file queries does not match file previously requested.\")\n\t\t}\n\t}\n}",
"func (t *SpotifyDevice) Play() {\n\tif t.client == nil {\n\t\treturn\n\t}\n\tlog.Println(\"Playing on Spotify device\")\n\tif err := t.client.PlayOpt(t.playOpts); err != nil {\n\t\tlog.Println(err)\n\t}\n}",
"func (e *Engine) Play(playbackEvents ...*playbackEvent) {\n\te.Lock()\n\tdefer e.Unlock()\n\n\t// check that there are playback events first\n\tif playbackEvents == nil {\n\t\treturn\n\t}\n\n\t// add the events to the internal active event \"set\"\n\tfor _, playbackEvent := range playbackEvents {\n\t\t// queue the playback event (shouldn't block, because the\n\t\t// channel is buffered with a large (magic) number unlikely\n\t\t// to be surpassed for audio applications...)\n\t\te.newPlaybackEvents <- playbackEvent\n\t}\n}",
"func playSong(songBeat *model.SongBeat, player player.NotePlayer) {\n\n\tconst secondsInMinute float64 = 60.0\n\tconst songPlayTimeInSeconds = 20\n\n\tsecondsPerBeat := secondsInMinute / float64(songBeat.BeatsPerMinute)\n\tsecondsPerNote := secondsPerBeat / float64(songBeat.NotesPerBeat)\n\n\tnotesToPlay := getNotesToPlay(songBeat)\n\n\tnoteTicker := getNoteTicker(secondsPerNote)\n\tdone := make(chan bool)\n\n\tgo playNotes(done, noteTicker, player, notesToPlay)\n\n\ttime.Sleep(songPlayTimeInSeconds * time.Second)\n\tnoteTicker.Stop()\n\tdone <- true\n}",
"func receive_mp3(server net.Conn, play chan bool, stop chan bool) {\n\tdefer server.Close()\n\tfor {\n\t\tselect {\n\t\tcase <-stop:\n\t\t\treturn\n\t\tcase <-play:\n\t\t\tdecoder, err := mp3.NewDecoder(server)\n\t\t\tif err != nil && err == io.EOF {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif err != nil && err != io.EOF {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tdefer decoder.Close()\n\t\t\tplayer, err := oto.NewPlayer(decoder.SampleRate(), 2, 2, 8192)\n\t\t\tif err != nil && err == io.EOF {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif err != nil && err != io.EOF {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tdefer player.Close()\n\n\t\t\tgo func() {\n\t\t\t\t_, _ = io.Copy(player, decoder)\n\t\t\t}()\n\t\t}\n\t}\n}",
"func (asf *File) IsPlaying(animName string) bool {\n\n\tif asf.CurrentAnimation != nil && asf.CurrentAnimation.Name == animName {\n\t\treturn true\n\t}\n\n\treturn false\n}",
"func (player *musicPlayer) addFile(fileName string) (string, error) {\n\tif !isSupportedType(fileName) {\n\t\treturn \"\", errors.New(format_not_supported_msg)\n\t}\n\t_, err := os.Stat(fileName)\n\tif os.IsNotExist(err) {\n\t\treturn \"\", errors.New(file_not_found_msg)\n\t}\n\tplayer.state.queue = append(player.state.queue, fileName)\n\treturn fileName, nil\n}",
"func StartSound() error {\n\treturn globalSoundBuffer.Play(0, ds.BPLAY_LOOPING)\n}",
"func (self *EventsOnDisk) Replay(streamId string, receiver EventHandler) error {\n\tin, err := os.Open(self.filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdec := json.NewDecoder(in)\n\tfor {\n\t\tevent := Event{}\n\t\terr := dec.Decode(&event)\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t} else if err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif streamId == \"*\" || streamId == event.StreamId {\n\t\t\treceiver.HandleEvent(&event)\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (pp *playerPlayback) playUntilStopped(c context.Context) {\n\t// When finished, close our stream.\n\tdefer func() {\n\t\t// Stop our timer.\n\t\tif pp.timer != nil {\n\t\t\tpp.timer.Stop()\n\t\t}\n\n\t\tif err := pp.sr.Close(); err != nil {\n\t\t\tpp.logger.Warnf(\"Failed to close stream for %q: %s\", pp.sr.Path(), err)\n\t\t}\n\n\t\t// Signal that we've finished.\n\t\tclose(pp.finishedC)\n\n\t\t// Release our playback lease, if we have one.\n\t\tpp.leaser.ReleasePlaybackLease()\n\n\t\t// Consume any superfluous commands.\n\t\t//\n\t\t// Since finishedC is closed, no new commands will be sent.\n\t\tfor range pp.commandC {\n\t\t}\n\t}()\n\n\t// Set our playing metric. Clear them when we're finished.\n\tplayerPlayingGauge.Set(1)\n\tplayerPausedGauge.Set(0)\n\tplayerCyclesGauge.Set(0)\n\tdefer func() {\n\t\tplayerPlayingGauge.Set(0)\n\t\tplayerPausedGauge.Set(0)\n\t\tplayerCyclesGauge.Set(0)\n\t}()\n\n\t// Acquire a playback lease.\n\tpp.leaser.AcquirePlaybackLease()\n\n\t// Playback until finished.\n\tpp.playerStartTime = time.Now()\n\n\tfor {\n\t\t// Check to see if the Context is cancelled yet.\n\t\tselect {\n\t\tcase <-c.Done():\n\t\t\treturn\n\t\tdefault:\n\t\t}\n\n\t\t// Begin the next round.\n\t\tplayerCyclesGauge.Inc()\n\t\tpp.logger.Infof(\"Starting player round #%d for %q...\", pp.roundCount, pp.sr.Path())\n\t\tpp.roundCount++\n\n\t\t// Reset our stream to its starting position.\n\t\tif err := pp.sr.Reset(); err != nil {\n\t\t\tpp.logger.Errorf(\"Failed to reset stream: %s\", err)\n\t\t}\n\n\t\tif err := pp.playRound(c); err != nil && errors.Cause(err) != context.Canceled {\n\t\t\tpp.logger.Warnf(\"Error during playback: %s\", err)\n\t\t\tplayerErrors.Inc()\n\t\t\treturn\n\t\t}\n\t}\n}",
"func (player *Player) Next() {\n\tplayer.obj.Call(\"org.mpris.MediaPlayer2.Player.Next\", 0)\n}",
"func QueueWAV(filepath string) (*mix.Chunk, error) {\n\t// Load in BG wav\n\tdata, err := ioutil.ReadFile(\"sfx/streets.wav\")\n\tif err != nil {\n\t\treturn &mix.Chunk{}, err\n\t}\n\n\tchunk, err := mix.QuickLoadWAV(data)\n\tif err != nil {\n\t\treturn &mix.Chunk{}, err\n\t}\n\t// defer chunk.Free()\n\treturn chunk, nil\n}"
] | [
"0.7252763",
"0.7192853",
"0.67938113",
"0.6674443",
"0.6330063",
"0.6231709",
"0.61893684",
"0.60480857",
"0.596612",
"0.5936501",
"0.59290355",
"0.59035736",
"0.5845777",
"0.5829224",
"0.5784471",
"0.5781998",
"0.57748026",
"0.5744766",
"0.5742472",
"0.5707918",
"0.5701077",
"0.56959224",
"0.56724113",
"0.56712186",
"0.5636537",
"0.55625135",
"0.552176",
"0.55071294",
"0.5502929",
"0.54823226",
"0.54659635",
"0.5432786",
"0.54246324",
"0.5422784",
"0.53710544",
"0.53524536",
"0.5319811",
"0.5311518",
"0.52841413",
"0.52828383",
"0.52518487",
"0.52495015",
"0.5246138",
"0.5232728",
"0.52174175",
"0.52157396",
"0.5203959",
"0.52028304",
"0.51880217",
"0.5178038",
"0.51657575",
"0.5151551",
"0.5144911",
"0.5140823",
"0.51133925",
"0.51067543",
"0.5097039",
"0.5092185",
"0.5086892",
"0.5071683",
"0.5071669",
"0.5067315",
"0.50458765",
"0.50446916",
"0.50164455",
"0.5014726",
"0.50121176",
"0.50097513",
"0.49941626",
"0.4971399",
"0.49554175",
"0.49553457",
"0.4953889",
"0.49538675",
"0.49126744",
"0.48790938",
"0.486076",
"0.48483232",
"0.48471084",
"0.4820917",
"0.479082",
"0.47779843",
"0.47667307",
"0.47492865",
"0.473523",
"0.47209513",
"0.47075713",
"0.47067127",
"0.4705755",
"0.47045",
"0.46970543",
"0.4689824",
"0.46876457",
"0.4685599",
"0.46853617",
"0.46830103",
"0.46812367",
"0.46770433",
"0.4671939",
"0.46485206"
] | 0.6597008 | 4 |
play plays a file, directory or playlists Returns error if nothing is to be played | func (player *musicPlayer) play(playItem string) ([]string, error) {
player.Lock()
player.stopFlow()
player.state.queue = make([]string, 0)
player.state.current = 0
items, err := player.addPlayItem(playItem)
player.Unlock()
// play all items
ch := make(chan error)
defer close(ch)
if err == nil {
go player.playQueue(0, ch)
err = <-ch
}
return items, err
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (player *AudioPlayer) PlayFile(fileName string) error {\n\tmplayer := exec.Command(\"mplayer\", player.AudioFolder+\"/\"+fileName+\".mp3\")\n\treturn mplayer.Run()\n}",
"func playHelper(fname string) {\n\tcolorprint.Info(\">>>> Please enter the name of the file that you would like to play\")\n\tfmt.Scan(&fname)\n\tcolorprint.Debug(\"<<<< \" + fname)\n\tplayer.Filename = fname\n\tfor _, element := range filePaths.Files {\n\t\tif element.Name == fname {\n\t\t\tplayer.Filepath = element.Path\n\t\t}\n\t}\n\n\tplayer.Run()\n}",
"func (s *Service) PlayFile(path string) error {\n\t// check if file exists if it is not a remote video.\n\tif _, err := os.Stat(path); os.IsNotExist(err) && !strings.Contains(path, \"http\") {\n\t\ts.client.logger.WithFields(log.Fields{\"path\": path}).Info(ErrFileNotFound)\n\t\treturn ErrFileNotFound\n\t}\n\n\t// start playing file.\n\tif err := s.SetProperty(\"pause\", \"no\"); err != nil {\n\t\treturn err\n\t}\n\tif err := s.SetCommand(\"loadfile\", path); err != nil {\n\t\treturn err\n\t}\n\ts.client.logger.WithFields(log.Fields{\"video\": path}).Info(\"playing video\")\n\treturn nil\n}",
"func (c *Client) Play(guildID string, trackID string, options ...play.Option) error {\n\tp := play.New(guildID, trackID)\n\n\tfor _, option := range options {\n\t\tif err := option(p); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn c.send(p)\n}",
"func (n *Notifier) Play(ctx context.Context, url string) error {\n\tmedia, err := n.client.Media(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\titem := controllers.MediaItem{\n\t\tContentId: url,\n\t\tStreamType: \"BUFFERED\",\n\t\tContentType: \"audio/mpeg\",\n\t}\n\t_, err = media.LoadMedia(ctx, item, 0, true, map[string]interface{}{})\n\treturn err\n}",
"func (_m *Gamer) Play(args ...string) {\n\t_m.Called(args)\n}",
"func (f *FilePlayer) Play(fileName string, fileType string, device string) (err error) {\n\toptions, err := producePlayOptions(fileName, fileType, device)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgo playAudio(options, f.doneCh)\n\treturn\n}",
"func (c *Client) Play(url string) (e error) {\n\tclient := cast.NewClient(c.ip, c.port)\n\tdefer func() {\n\t\tif err := recover(); err != nil {\n\t\t\te = fmt.Errorf(\"Panic occurs on Play [%w]\", err)\n\t\t}\n\t}()\n\n\terr := client.Connect(c.ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer client.Close()\n\tclient.Receiver().QuitApp(c.ctx)\n\n\tmedia, err := client.Media(c.ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\titem := controllers.MediaItem{\n\t\tContentId: url,\n\t\tStreamType: \"BUFFERED\",\n\t\tContentType: \"audio/mpeg\",\n\t}\n\t_, err = media.LoadMedia(c.ctx, item, 0, true, map[string]interface{}{})\n\treturn err\n}",
"func play(w http.ResponseWriter, r *http.Request, token string) {\n\tdefer fmt.Println(\"---\")\n\n\tfmt.Println(\"play method:\", r.Method) // get request method\n\n\tfmt.Println(\"play token:\", token)\n\tif token == \"\" {\n\t\thttp.Error(w, \"no token in play\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tplayer, ok := players[token]\n\tif !ok {\n\t\thttp.Error(w, \"no player for token \"+token, http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tfmt.Println(player)\n\terr := playTmpl.Execute(w, player)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t}\n}",
"func (g *CastDevice) Play(ctx context.Context, url *url.URL) error {\n\tconn := castnet.NewConnection()\n\tif err := conn.Connect(ctx, g.AddrV4, g.Port); err != nil {\n\t\treturn err\n\t}\n\tdefer conn.Close()\n\n\tstatus, err := g.client.Receiver().LaunchApp(ctx, cast.AppMedia)\n\tif err != nil {\n\t\treturn err\n\t}\n\tapp := status.GetSessionByAppId(cast.AppMedia)\n\n\tcc := controllers.NewConnectionController(conn, g.client.Events, cast.DefaultSender, *app.TransportId)\n\tif err := cc.Start(ctx); err != nil {\n\t\treturn err\n\t}\n\tmedia := controllers.NewMediaController(conn, g.client.Events, cast.DefaultSender, *app.TransportId)\n\tif err := media.Start(ctx); err != nil {\n\t\treturn err\n\t}\n\n\tmediaItem := controllers.MediaItem{\n\t\tContentId: url.String(),\n\t\tContentType: \"audio/mp3\",\n\t\tStreamType: \"BUFFERED\",\n\t}\n\n\tlog.Printf(\"[INFO] Load media: content_id=%s\", mediaItem.ContentId)\n\t_, err = media.LoadMedia(ctx, mediaItem, 0, true, nil)\n\n\treturn err\n}",
"func (d *Demo) Play() {\n\t//Steam isn't in PATH on windows systems, have to specify steam path\n\tcmd := exec.Command(\"steam\", \"-applaunch\", \"440\", \"+playdemo\", d.PathInTFFolder())\n\tif runtime.GOOS == \"windows\" {\n\t\tcmd = exec.Command(\"cmd\", \"/c\", \"start\", \"\", `C:\\Program Files (x86)\\Steam\\Steam.exe`,\n\t\t\t\"-applaunch\", \"440\", \"+playdemo\", d.PathInTFFolder())\n\t}\n\tcmd.Start()\n}",
"func (j Jibi) Play() {\n\tj.RunCommand(CmdPlay, nil)\n}",
"func (player *Player) Play() {\n\tplayer.obj.Call(\"org.mpris.MediaPlayer2.Player.Play\", 0)\n}",
"func PlaySong(ctx framework.Context) {\n\n\targs := strings.Join(ctx.Args, \" \")\n\n\t// Resume playing if no args\n\tif args == \"\" {\n\t\tif !ctx.MediaPlayer.IsConnected {\n\t\t\tif len(ctx.MediaPlayer.Queue) == 0 {\n\t\t\t\tctx.ReplyEmbed(\"Oops!\", \"No song to play!\", 0xEB5160)\n\t\t\t} else {\n\t\t\t\tctx.MediaPlayer.StartPlaying(ctx.Discord, ctx.Guild, ctx.Message.Author.ID)\n\t\t\t}\n\t\t} else if err := CheckSameChannel(ctx); err != nil {\n\t\t\tlog.Println(err)\n\t\t} else if err := ctx.MediaPlayer.Resume(); err != nil {\n\t\t\tctx.ReplyEmbed(\"Oops!\", \"No song to play!\", 0xEB5160)\n\t\t}\n\n\t\treturn\n\t}\n\n\t// Get song details\n\tvar song framework.Song\n\tsong.Id, song.Title, song.Duration = GetMetaData(args)\n\n\tif song.Id == \"\" {\n\t\tctx.ReplyEmbed(\"Oops!\", args+\" not found\", 0xEB5160)\n\t\treturn\n\t}\n\n\t// Check if duration is too long\n\tif d, err := time.ParseDuration(song.Duration); err != nil {\n\t\tctx.ReplyEmbed(\"Oops!\", \"Encountered an error\", 0xEB5160)\n\t\treturn\n\t} else {\n\t\tlmt, _ := time.ParseDuration(\"1h\")\n\n\t\tif d > lmt {\n\t\t\tctx.ReplyEmbed(\"Oops!\", \"Song length too long\", 0xEB5160)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Check if song present locally\n\t_, ok := ctx.SongIdList.IdList[song.Id]\n\tif !ok {\n\t\t// Get the song in dca format\n\t\tif err := GetSong(song.Id); err != nil {\n\t\t\tlog.Println(\"PlaySong(): \" + err.Error())\n\t\t\tctx.ReplyEmbed(\"Oops!\", err.Error(), 0xEB5160)\n\t\t\treturn\n\t\t}\n\n\t\t// Update song in program and file system\n\t\tif err := ctx.SongIdList.UpdateSongs(song); err != nil {\n\t\t\tlog.Println(\"PlaySong(): \" + err.Error())\n\t\t\tctx.ReplyEmbed(\"Oops!\", \"Unable to load song\", 0xEB5160)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Add song to queue\n\tctx.MediaPlayer.AddSongs(song)\n\n\t// start the player if its not running\n\tif !ctx.MediaPlayer.IsConnected {\n\t\tgo ctx.MediaPlayer.StartPlaying(ctx.Discord, ctx.Guild, ctx.Message.Author.ID)\n\t} else if ctx.MediaPlayer.IsPaused {\n\t\tctx.MediaPlayer.Resume()\n\t}\n\n\tctx.ReplyEmbed(song.Title+\" queued!\", \"\", 0xFFD900)\n}",
"func playCurrentSamples(samplePaths []string) {\n for _, samplePath := range samplePaths {\n go playback.PlayFile(samplePath)\n }\n}",
"func PlayFromURL(token *string, uri string) (err error) {\n\turiKind := strings.Split(uri, \":\")[1]\n\tvar values []byte\n\tif uriKind == track {\n\t\tvalues, err = json.Marshal(playJSON{URIs: []string{uri}})\n\t} else {\n\t\tvalues, err = json.Marshal(playListJSON{ContextURI: uri})\n\t}\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = CreateRequest(token, requesttypes.PUT, \"/me/player/play\", bytes.NewBuffer(values))\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn\n}",
"func Play(localmid string) error {\n\treturn fmt.Errorf(\"Sorry, cliaoke is only supported on linux and darwin, consider making a PR for what I can only imagine is openbsd or windows. Clippy says DO IT!\")\n}",
"func (d *defaultMusicPlayer) PlayMusic(input chan []byte, guildID string, vc Channel, mainPlaylist bool) {\n\tif !vc.ExistsNext() && mainPlaylist {\n\t\tpanic(\"Song does not exist in playlist but PlayMusic was called.\")\n\t} else if !vc.ExistsBackupNext() && !mainPlaylist {\n\t\tpanic(\"Song does not exist in backup playlist but PlayMusic was called.\")\n\t}\n\n\tvar song *playlist.Song\n\tvar aborted bool\n\n\tif mainPlaylist {\n\t\tsong = vc.GetNext()\n\t} else {\n\t\tsong = vc.GetBackupNext()\n\t}\n\n\tdefer func() {\n\t\tif aborted {\n\t\t\treturn\n\t\t}\n\n\t\tvc.RemoveNowPlaying()\n\n\t\tif vc.ExistsNext() {\n\t\t\tgo d.PlayMusic(input, guildID, vc, true)\n\t\t} else if vc.ExistsBackupNext() {\n\t\t\tgo d.PlayMusic(input, guildID, vc, false)\n\t\t}\n\t}()\n\n\tencodeSession, err := dca.EncodeFile(ytmp3.PathToAudio(song.YoutubeID), dca.StdEncodeOptions)\n\tif err != nil {\n\t\tlog.Print(err)\n\t\treturn\n\t}\n\tdefer encodeSession.Cleanup()\n\n\tdecoder := dca.NewDecoder(encodeSession)\n\tabortChannel := ActiveVoiceChannels[guildID].GetAbortChannel()\n\n\tfor {\n\t\tframe, err := decoder.OpusFrame()\n\t\tif err != nil {\n\t\t\tif err != io.EOF {\n\t\t\t\tlog.Print(err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\t// Do something with the frame, in this example were sending it to discord\n\t\tselect {\n\t\tcase input <- frame:\n\t\tcase <-abortChannel:\n\t\t\taborted = true\n\t\t\treturn\n\t\tcase <-time.After(time.Second):\n\t\t\t// We haven't been able to send a frame in a second, assume the connection is borked\n\t\t\tlog.Println(\"TIMEOUT: Unable to send audio..\")\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}",
"func (s *Server) PlayNow(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tuidStr, ufound := vars[\"uid\"]\n\tpidStr, pfound := vars[\"pid\"]\n\tsidStr, sfound := vars[\"sid\"]\n\n\tif !ufound || !pfound || !sfound {\n\t\turlerror(w)\n\t\treturn\n\t}\n\n\tp, err := s.pm.Party(PartyUUID(pidStr))\n\tif err != nil {\n\t\terrMsg := jsonError(\"no such party\")\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tw.Write(errMsg)\n\n\t\treturn\n\t}\n\n\t// try to play the song\n\terr = p.PlayNow(party.UserUUID(uidStr), party.SongUID(sidStr))\n\tif err != nil {\n\t\terrMsg := jsonError(\"%s\", err.Error())\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tw.Write(errMsg)\n\t}\n\n\t// exit with OK status code\n}",
"func (p *Player) Play(c context.Context, sr *streamfile.EventStreamReader) {\n\t// Stop any currently-playing file.\n\tp.Stop()\n\n\t// We will cancel the Context ourselves on Stop. Retain this Context.\n\tp.ctx, p.cancelFunc = context.WithCancel(c)\n\tc = p.ctx\n\n\t// Initialize player resources.\n\tp.playback = &playerPlayback{\n\t\tplayer: p,\n\t\tsr: sr,\n\t\tlogger: logging.Must(p.Logger),\n\t\tleaser: p.PlaybackLeaser,\n\t\tnoRouteDevices: make(map[int64]int64),\n\t\tcommandC: make(chan *playerCommand),\n\t\timmediateC: make(chan time.Time),\n\t\tfinishedC: make(chan struct{}),\n\t}\n\tclose(p.playback.immediateC) // Always closed.\n\n\t// Must not have a nil leaser.\n\tif p.playback.leaser == nil {\n\t\tp.playback.leaser = noopPlaybackLeaser{}\n\t}\n\n\t// Start the player goroutine.\n\t//\n\t// We will play until the Context is cancelled.\n\tgo func() {\n\t\tdefer func() {\n\t\t}()\n\t\tp.playback.playUntilStopped(c)\n\t}()\n}",
"func (s *Service) PlaySong() {\n\tfor {\n\t\tselect {\n\t\tcase <-s.playChan:\n\t\t\tfor len(s.queue) > 0 {\n\t\t\t\ts.cmd = exec.Command(\"mpv\", \"--no-terminal\", \"--no-video\", s.queue[0])\n\t\t\t\ts.cmd.Run()\n\t\t\t\ts.queue.pop()\n\t\t\t}\n\t\t}\n\t}\n}",
"func (o *OMXPlayer) Play() error {\n\tif o.status == statusPlaying {\n\t\treturn nil\n\t}\n\n\t// TODO: test this properly by mocking dbus package.\n\tif o.testing {\n\t\to.status = statusPlaying\n\t\treturn nil\n\t}\n\n\t_, err := o.dbusSend(\"Play\", dbus.FlagNoAutoStart)\n\tif err != nil {\n\t\treturn err\n\t}\n\to.status = statusPlaying\n\treturn nil\n}",
"func (r *Radio) Play(b *dream.Session, vc *discordgo.VoiceConnection) (*dream.AudioDispatcher, error) {\n\tsong, err := r.Queue.Song()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar stream io.ReadCloser\n\n\tif r.UseYoutubeDL {\n\t\tyt := exec.Command(\"youtube-dl\", \"-f\", \"bestaudio\", \"--youtube-skip-dash-manifest\", \"-o\", \"-\", song.URL)\n\t\tstream, err = yt.StdoutPipe()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\terr = yt.Start()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tstream, err = util.YoutubeDL(song.URL)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tdisp := b.PlayStream(vc, stream)\n\treturn disp, nil\n}",
"func (phone *Ph0n3) play(freq float64, duration time.Duration, wg *sync.WaitGroup) {\n\tdefer func() {\n\t\tif wg != nil {\n\t\t\twg.Done()\n\t\t}\n\t}()\n\tp := phone.ctx.NewPlayer()\n\ts := newSineWave(freq, duration, phone.opt.Channel)\n\tif _, err := io.Copy(p, s); err != nil {\n\t\tlog.Printf(\"%v\", err)\n\t\treturn\n\t}\n\tif err := p.Close(); err != nil {\n\t\tlog.Printf(\"%v\", err)\n\t\treturn\n\t}\n\treturn\n}",
"func RunSound(path string) {\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\t// Create a new beep.Decoder\n\tstreamer, format, err := mp3.Decode(f)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\tdefer streamer.Close()\n\t// Create a new beep.Player\n\tspeaker.Init(format.SampleRate, format.SampleRate.N(time.Second/10))\n\n\tdone := make(chan bool)\n\t// Play the stream\n\tspeaker.Play(beep.Seq(streamer, beep.Callback(func() {\n\t\tdone <- true\n\t})))\n\n\t<-done\n}",
"func (c *Client) PlaySound(path string) error {\n\tfh, err := os.Open(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer fh.Close()\n\n\tbytes, err := ioutil.ReadAll(fh)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgo c.playRaw(bytes)\n\treturn nil\n}",
"func (player *AudioPlayer) PlayText(text string) {\n\tspeech := htgotts.Speech{Folder: player.AudioFolder, Language: player.Language}\n\tspeech.Speak(text)\n}",
"func playSound(s *discord.Session, guildID, channelID, videoURL string) (err error) {\n\t// Join the provided voice channel.\n\tvc, err := s.ChannelVoiceJoin(guildID, channelID, false, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\twithSpeaking := func() error { return stream(vc, videoURL) }\n\twithSleepFn := func() error { return wrapWithSpeaking(withSpeaking, vc) }\n\tf := func() error { return wrapWithSleep(withSleepFn, 250*time.Millisecond, 250*time.Millisecond, false) }\n\n\t// Call the payload.\n\terr1 := f()\n\n\t// Disconnect from the provided voice channel.\n\tif err := vc.Disconnect(); err != nil && err1 == nil {\n\t\treturn err\n\t}\n\treturn err1\n}",
"func (omx OmxPlayer) CanPlay(path string) bool {\n\tif omx.supportedTypes.Match([]byte(path)) {\n\t\treturn true\n\t}\n\treturn false\n}",
"func (tr *trooper) play(sound uint32) { tr.part.PlaySound(sound) }",
"func ImportPlay(path string) (*Play, error) {\n var play Play\n err := ImportComponent(path, &play)\n return &play, err\n}",
"func playAzan(azanFile string) {\n\tcmd := exec.Command(\"mpg123\", azanFile)\n\terr := cmd.Run()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n}",
"func (p *Player) Play() error {\n\tif p.player == nil {\n\t\treturn errors.New(\"player must be initialized first\")\n\t}\n\tif p.IsPlaying() {\n\t\treturn nil\n\t}\n\n\tif C.libvlc_media_player_play(p.player) < 0 {\n\t\treturn getError()\n\t}\n\n\treturn nil\n}",
"func (c *Sound) Play(times int) {\n\t// if err := c.resource.GetResource().Play(times); err != nil {\n\tif sound, format := c.resource.GetResource(); sound != nil {\n\t\tif format == engosdl.SoundMP3 {\n\t\t\tif err := sound.(*mix.Music).FadeIn(times, 2500); err != nil {\n\t\t\t\tengosdl.Logger.Error().Err(err).Msg(\"play mix MP3 resource error\")\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t} else if format == engosdl.SoundWAV {\n\t\t\tif _, err := sound.(*mix.Chunk).Play(1, 1); err != nil {\n\t\t\t\tengosdl.Logger.Error().Err(err).Msg(\"play mix WAV resource error\")\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t}\n}",
"func (a *HipchatAdapter) Play(res *Response, strings ...string) error {\n\treturn nil\n}",
"func (p *Player) play(t *perceptor.Track) error {\n\t// Reset Pause State\n\tPAUSE_DURATION = 0\n\tPAUSE_START = time.Time{}\n\n\t// Get the track\n\ttrack, err := p.loadTrack(t.Uri)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Load the Track\n\tlog.Info(\"Load Track into Player\")\n\tif err := p.player.Load(track); err != nil {\n\t\treturn err\n\t}\n\n\t// Defer unloading the track until we exit this func\n\tdefer p.player.Unload()\n\n\t// Send play event to perspector - go routine so we don't block\n\tgo func() {\n\t\tp.pcptr.Play(t, time.Now().UTC())\n\t\treturn\n\t}()\n\n\t// Play the track\n\tlog.Println(fmt.Sprintf(\"Playing: %s\", t.Uri))\n\tp.player.Play() // This does NOT block, we must block ourselves\n\n\t// Go routine to listen for end of track updates from the player, once we get one\n\t// send a message to our own StopTrack channel\n\tgo func() {\n\t\t<-p.session.EndOfTrackUpdates() // Blocks\n\t\tlog.Debug(\"End of Track Updates\")\n\t\tp.channels.Stop <- true\n\t\treturn\n\t}()\n\n\t<-p.channels.Stop // Blocks\n\tlog.Infof(fmt.Sprintf(\"Track stopped: %s\", t.Uri))\n\n\treturn nil\n}",
"func PlayMusic(input chan []byte, guildID string, vc Channel, main bool) {\n\tgo DefaultMusicPlayer.PlayMusic(input, guildID, vc, main)\n}",
"func (p player) Play(ctx context.Context, b tictactoe.Board, mark tictactoe.State) (tictactoe.Move, error) {\n\t// Outsource our decision-making process to the human.\n\t// They know what they're doing. Hopefully.\n\treturn <-p.chosenMove, nil\n}",
"func (player *musicPlayer) playQueue(trim float64, ch chan error) {\n\tplayer.playQueueMutex.Lock()\n\tdefer player.playQueueMutex.Unlock()\n\tplay := true\n\tfirst := true\n\tplayer.Lock()\n\tplayer.state.status = waiting\n\tplayer.Unlock()\n\tfor play {\n\t\tvar fileName string\n\t\tplayer.Lock()\n\t\tif player.state.status == paused {\n\t\t\tplay = false\n\t\t} else {\n\t\t\tindex := player.state.current\n\t\t\tif index < len(player.state.queue) {\n\t\t\t\tfileName = player.state.queue[index]\n\t\t\t} else {\n\t\t\t\tplay = false\n\t\t\t\tplayer.state.current = 0\n\t\t\t\tplayer.state.status = waiting\n\t\t\t}\n\t\t}\n\t\tplayer.Unlock()\n\n\t\tif play && len(fileName) > 0 {\n\t\t\tfmt.Println(\"play queue - song to be played \", fileName)\n\t\t\tif first {\n\t\t\t\tfirst = false\n\t\t\t\tplayer.playSingleFile(fileName, trim, ch)\n\t\t\t} else {\n\t\t\t\tplayer.playSingleFile(fileName, trim, nil)\n\t\t\t}\n\t\t\ttrim = 0\n\n\t\t\tplayer.Lock()\n\t\t\tif player.state.status == waiting {\n\t\t\t\tplayer.state.current += 1\n\t\t\t}\n\t\t\tplayer.Unlock()\n\t\t}\n\t}\n}",
"func playSound(s *discordgo.Session, guildID, channelID string) (err_r error) {\n\n\tif playing {\n\t\treturn nil\n\t}\n\n\trand_num := rand.Int()%len(sliceData)\n\tmsg_string := sliceData[rand_num]\n\tfile_name := strconv.Itoa(rand_num)+\".mp3\"\n\tvar err error\n\tos.Setenv(\"GOOGLE_APPLICATION_CREDENTIALS\",\"INSERT YOUR GOOGLE CLOUD CREDENTIALS HERE\")\n\tif Exists(file_name) {\n\t\tlog.Println(\"file found: \", file_name)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Error opening mp3 file :\", err)\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tlog.Println(\"file not found: \", file_name)\n\t\tctx := context.Background()\n\n\t\tclient, err := texttospeech.NewClient(ctx)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tdefer client.Close()\n\n\t\t// Perform the text-to-speech request on the text input with the selected\n\t\t// voice parameters and audio file type.\n\t\treq := texttospeechpb.SynthesizeSpeechRequest{\n\t\t\t// Set the text input to be synthesized.\n\t\t\tInput: &texttospeechpb.SynthesisInput{\n\t\t\t\tInputSource: &texttospeechpb.SynthesisInput_Text{Text: msg_string},\n\t\t\t},\n\t\t\t// Build the voice request, select the language code and the SSML\n\t\t\t// voice gender.\n\t\t\tVoice: &texttospeechpb.VoiceSelectionParams{\n\t\t\t\tLanguageCode: \"ru-RU\",\n\t\t\t\tSsmlGender: texttospeechpb.SsmlVoiceGender_MALE,\n\t\t\t\tName: \"ru-RU-Wavenet-D\",\n\t\t\t},\n\t\t\t// Select the type of audio file you want returned.\n\t\t\tAudioConfig: &texttospeechpb.AudioConfig{\n\t\t\t\tAudioEncoding: texttospeechpb.AudioEncoding_MP3,\n\t\t\t},\n\t\t}\n\n\t\tresp, err := client.SynthesizeSpeech(ctx, &req)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\t// The resp's AudioContent is binary.\n\t\tfile_name = strconv.Itoa(rand_num) + \".mp3\"\n\t\terr = ioutil.WriteFile(file_name, resp.AudioContent, 0644)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tfmt.Printf(\"Audio content written to file: %v\\n\", file_name)\n\n\t\tlog.Println(file_name)\n\n\t}\n\n\t//encode mp3 to dca\n\toptions := dca.StdEncodeOptions\n\toptions.RawOutput = true\n\toptions.Bitrate = 128\n\toptions.Application = \"lowdelay\"\n\n\tencodeSession, err := dca.EncodeFile(file_name, options)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer encodeSession.Cleanup()\n\n\n\t// Join the provided voice channel.\n\tvc, err := s.ChannelVoiceJoin(guildID, channelID, false, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\tplaying = true\n\n\t// Sleep for a specified amount of time before playing the sound\n\ttime.Sleep(250 * time.Millisecond)\n\n\t// Start speaking.\n\tvc.Speaking(true)\n\n\tdone := make(chan error)\n\tdca.NewStream(encodeSession, vc, done)\n\terr = <-done\n\tif err != nil && err != io.EOF {\n\t\treturn\n\t}\n\n\t// Stop speaking\n\tvc.Speaking(false)\n\n\t// Sleep for a specified amount of time before ending.\n\ttime.Sleep(250 * time.Millisecond)\n\n\t// Disconnect from the provided voice channel.\n\tvc.Disconnect()\n\n\tplaying = false\n\n\treturn nil\n\n}",
"func (c *Chrome) Play() error {\n\tmsg := wsMessage{\n\t\tComponent: \"player\",\n\t\tMethod: \"play\",\n\t}\n\n\t// TODO: create convenience method that sends and waits?\n\tsend := c.ConnViewer.getChanSend()\n\tsend <- msg\n\t// Wait for response\n\tres := <-c.ConnViewer.getChanReceive()\n\treturn handleRes(res)\n}",
"func Play(w http.ResponseWriter, r *http.Request) {\n\tfmt.Println(\"Received Request: /MediaControls\")\n\taction := strings.TrimPrefix(r.URL.Path, \"/MediaControls/\")\n\tfmt.Println(\"Action:\", action)\n\n\tvar URL *url.URL\n\tURL, err := url.Parse(\"https://api.spotify.com\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tURL.Path += \"/v1/me/player/play\"\n\n\tclient := &http.Client{}\n\treq := &http.Request{}\n\n\tif sPlayerContext != sCurrentPlaylist.PlaylistURI {\n\t\treqBody := map[string]interface{}{\n\t\t\t\"context_uri\": sCurrentPlaylist.PlaylistURI,\n\t\t}\n\t\tbytesRepresentation, err := json.Marshal(reqBody)\n\t\tif err != nil {\n\t\t\tlog.Fatalln(err)\n\t\t}\n\t\treq, err = http.NewRequest(\"PUT\", URL.String(), bytes.NewBuffer(bytesRepresentation))\n\t\tsPlayerContext = sCurrentPlaylist.PlaylistURI\n\t} else {\n\t\treq, err = http.NewRequest(\"PUT\", URL.String(), nil)\n\t}\n\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"Authorization\", \"Bearer \"+sAcsTok.AccessToken)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t_, err = client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n}",
"func (cr *Playback) Play() gin.HandlerFunc {\n\treturn func(c *gin.Context) {\n\t\tcurrentParty, err := session.CurrentParty(c)\n\t\tif err != nil {\n\t\t\tif err != sql.ErrNoRows {\n\t\t\t\tc.Error(e.Internal.CausedBy(err))\n\t\t\t\tc.Abort()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tc.Error(e.NotFound.WithMessage(\"Host has not started a party\"))\n\t\t\tc.Abort()\n\t\t\treturn\n\t\t}\n\n\t\tvar currentTrack models.PlayingTrack\n\t\tif !currentParty.CurrentTrack.Valid {\n\t\t\t// Begin playing the party's queue\n\t\t\tshuffleParam := c.Query(\"shuffle\")\n\t\t\tshuffle := shuffleParam != \"\" && shuffleParam != \"no\" && shuffleParam != \"0\"\n\n\t\t\tqueue, err := currentParty.QueueTracks()\n\t\t\tif err != nil {\n\t\t\t\tc.Error(e.Internal.CausedBy(err))\n\t\t\t\tc.Abort()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Shuffle the queue if requested\n\t\t\tif shuffle {\n\t\t\t\tqueue = models.Shuffle(queue)\n\t\t\t}\n\n\t\t\ttrack, err := cr.popTrackAndPlay(queue, currentParty.QueueID, currentParty.RoomCode)\n\t\t\tif err != nil {\n\t\t\t\tc.Error(e.Internal.CausedBy(err))\n\t\t\t\tc.Abort()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcurrentTrack = *track\n\t\t} else {\n\t\t\t// Resume the current track\n\t\t\terr = currentParty.CurrentTrack.Unmarshal(currentTrack)\n\t\t\tif err != nil {\n\t\t\t\tc.Error(e.Internal.CausedBy(err))\n\t\t\t\tc.Abort()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// It is a bad request to resume a track that is already playing\n\t\t\tif !currentTrack.Paused {\n\t\t\t\tc.Error(e.BadRequest.WithDetail(\"Current track is not paused\"))\n\t\t\t\tc.Abort()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentTrack.BeganPlaying = time.Now().UTC().Add(\n\t\t\t\ttime.Duration(currentTrack.Elapsed) * time.Second * -1,\n\t\t\t)\n\t\t}\n\n\t\tcurrentTrack.Paused = false\n\n\t\terr = cr.updateTrackAndBroadcast(currentParty, ¤tTrack)\n\t\tif err != nil {\n\t\t\tc.Error(e.Internal.CausedBy(err))\n\t\t\tc.Abort()\n\t\t\treturn\n\t\t}\n\n\t\tc.JSON(http.StatusOK, models.EmptyRespose)\n\t}\n}",
"func playScript(fsys fs.FS, transport string) {\n\tmodTime := time.Now()\n\tvar buf bytes.Buffer\n\tfor _, p := range scripts {\n\t\tb, err := fs.ReadFile(fsys, \"static/\"+p)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuf.Write(b)\n\t}\n\tfmt.Fprintf(&buf, \"\\ninitPlayground(new %v());\\n\", transport)\n\tb := buf.Bytes()\n\thttp.HandleFunc(\"/play.js\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-type\", \"application/javascript\")\n\t\thttp.ServeContent(w, r, \"\", modTime, bytes.NewReader(b))\n\t})\n}",
"func Play() {\r\n\t\r\n\tvar g Game\r\n\tg.initialize()\r\n\r\n\tfor !g.finished() {\r\n\t\tg.nextRound()\r\n\t}\r\n}",
"func (t Track) Play() {\n\tpanic(\"implement me\")\n}",
"func (c *Client) PlayHold(path string) error {\n\tfh, err := os.Open(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer fh.Close()\n\n\tbytes, err := ioutil.ReadAll(fh)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Play the loop in separate threads\n\tch := make(chan int16)\n\tgo c.Mumble.StreamAudio(ch)\n\tgo c.loopRaw(ch, bytes)\n\treturn nil\n}",
"func (ap *AudioPlayer) Play(done chan bool) {\n\tap.playCh <- apPlayRequest{done}\n}",
"func (b *Beeper) PlaySound(ctx context.Context, e pipanel.SoundEvent) error {\n\tif err := validateAudioFilename(e.Sound); err != nil {\n\t\treturn errors.Wrap(err, \"bad filename\")\n\t}\n\n\tpathToFile := b.cfg.LibraryPath + e.Sound + \".wav\"\n\n\tf, err := os.Open(pathToFile)\n\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"file not found: %s\", pathToFile)\n\t}\n\n\tstreamer, format, err := wav.Decode(f)\n\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"could not decode WAV audio\")\n\t}\n\n\tvar streamToPlay beep.Streamer = streamer\n\n\tif format.SampleRate != SampleRate {\n\t\tstreamToPlay = beep.Resample(4, format.SampleRate, SampleRate, streamer)\n\t}\n\n\tspeaker.Play(streamToPlay)\n\tb.log.WithContext(ctx).Printf(\"Playing sound: %s\", pathToFile)\n\n\treturn nil\n}",
"func (firstWinGame) Play(player1, _ pig.Player) pig.Player {\n\treturn player1\n}",
"func CallPlayer(file string) {\n\tvar player string\n\tif runtime.GOOS == \"windows\" {\n\t\tplayer = \"PotPlayerMini.exe\"\n\t} else {\n\t\tplayer = \"mpv\"\n\t}\n\texec.Command(player, file).Start()\n}",
"func (p *Pet) Play() {\n\tfmt.Println(p.Speak())\n}",
"func (t *SpotifyDevice) Play() {\n\tif t.client == nil {\n\t\treturn\n\t}\n\tlog.Println(\"Playing on Spotify device\")\n\tif err := t.client.PlayOpt(t.playOpts); err != nil {\n\t\tlog.Println(err)\n\t}\n}",
"func (e *Engine) Play(playbackEvents ...*playbackEvent) {\n\te.Lock()\n\tdefer e.Unlock()\n\n\t// check that there are playback events first\n\tif playbackEvents == nil {\n\t\treturn\n\t}\n\n\t// add the events to the internal active event \"set\"\n\tfor _, playbackEvent := range playbackEvents {\n\t\t// queue the playback event (shouldn't block, because the\n\t\t// channel is buffered with a large (magic) number unlikely\n\t\t// to be surpassed for audio applications...)\n\t\te.newPlaybackEvents <- playbackEvent\n\t}\n}",
"func playSound(s *discordgo.Session, guildID, channelID string) (err error) {\n\n\t// Join the provided voice channel.\n\tvc, err := s.ChannelVoiceJoin(guildID, channelID, false, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Sleep for a specified amount of time before playing the sound\n\ttime.Sleep(250 * time.Millisecond)\n\n\t// Start speaking.\n\tvc.Speaking(true)\n\t\n\t// Send the buffer data.\n\tfor _, buff := range buffer {\n\t\tvc.OpusSend <- buff\n\t}\n\n\t// Stop speaking\n\tvc.Speaking(false)\n\n\t// Sleep for a specificed amount of time before ending.\n\ttime.Sleep(250 * time.Millisecond)\n\n\t// Disconnect from the provided voice channel.\n\tvc.Disconnect()\n\n\treturn nil\n}",
"func (n *noise) Play(index int) {\n\tif n.loaded && index >= 0 && index < len(n.snds) {\n\t\tsnd := n.snds[index]\n\t\tif p, ok := n.eng.povs[n.eid]; ok {\n\t\t\tx, y, z := p.Location()\n\t\t\tgo func(sid uint64, x, y, z float64) {\n\t\t\t\tn.eng.machine <- &playSound{sid: sid, x: x, y: y, z: z}\n\t\t\t}(snd.sid, x, y, z)\n\t\t}\n\t}\n}",
"func (s *playSession) playSequence(ctx context.Context, p ari.Player, playbackCounter int) {\n\tseq := newSequence(s)\n\n\ts.mu.Lock()\n\ts.currentSequence = seq\n\ts.mu.Unlock()\n\n\tgo seq.Play(ctx, p, playbackCounter)\n\n\t// Wait for sequence playback to complete (or context closure to be caught)\n\tselect {\n\tcase <-ctx.Done():\n\tcase <-seq.Done():\n\t\tif s.result.Status == InProgress {\n\t\t\ts.result.Status = Finished\n\t\t}\n\t}\n\n\t// Stop audio playback if it is still running\n\tseq.Stop()\n\n\t// wait for cleanup of sequence so we can get the proper error result\n\t<-seq.Done()\n}",
"func play(freq float64, duration time.Duration) oto.Player {\n\ts := newSineWave(freq, duration)\n\tp := context.NewPlayer(s)\n\tp.Play()\n\treturn p\n}",
"func playSound(s *discordgo.Session, guildID, channelID string) (err error) {\n\n\t// Join the provided voice channel.\n\tvc, err := s.ChannelVoiceJoin(guildID, channelID, false, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Sleep for a specified amount of time before playing the sound\n\ttime.Sleep(250 * time.Millisecond)\n\n\t// Start speaking.\n\tvc.Speaking(true)\n\tkey := guildID + \":\" + channelID\n\tstopCh := make(chan int)\n\tstopMutex.Lock()\n\tstop[key] = &stopCh\n\tstopMutex.Unlock()\n\t// Send the buffer data.\n\tfunc() {\n\t\tfor _, buff := range buffer {\n\t\t\tselect {\n\t\t\tcase <-stopCh:\n\t\t\t\treturn\n\t\t\tdefault:\n\t\t\t\tvc.OpusSend <- buff\n\t\t\t}\n\t\t}\n\t}()\n\tclose(stopCh)\n\tdelete(stop, key)\n\n\t// Stop speaking\n\tvc.Speaking(false)\n\n\t// Sleep for a specificed amount of time before ending.\n\ttime.Sleep(250 * time.Millisecond)\n\n\t// Disconnect from the provided voice channel.\n\tvc.Disconnect()\n\n\treturn nil\n}",
"func (pp *playerPlayback) playUntilStopped(c context.Context) {\n\t// When finished, close our stream.\n\tdefer func() {\n\t\t// Stop our timer.\n\t\tif pp.timer != nil {\n\t\t\tpp.timer.Stop()\n\t\t}\n\n\t\tif err := pp.sr.Close(); err != nil {\n\t\t\tpp.logger.Warnf(\"Failed to close stream for %q: %s\", pp.sr.Path(), err)\n\t\t}\n\n\t\t// Signal that we've finished.\n\t\tclose(pp.finishedC)\n\n\t\t// Release our playback lease, if we have one.\n\t\tpp.leaser.ReleasePlaybackLease()\n\n\t\t// Consume any superfluous commands.\n\t\t//\n\t\t// Since finishedC is closed, no new commands will be sent.\n\t\tfor range pp.commandC {\n\t\t}\n\t}()\n\n\t// Set our playing metric. Clear them when we're finished.\n\tplayerPlayingGauge.Set(1)\n\tplayerPausedGauge.Set(0)\n\tplayerCyclesGauge.Set(0)\n\tdefer func() {\n\t\tplayerPlayingGauge.Set(0)\n\t\tplayerPausedGauge.Set(0)\n\t\tplayerCyclesGauge.Set(0)\n\t}()\n\n\t// Acquire a playback lease.\n\tpp.leaser.AcquirePlaybackLease()\n\n\t// Playback until finished.\n\tpp.playerStartTime = time.Now()\n\n\tfor {\n\t\t// Check to see if the Context is cancelled yet.\n\t\tselect {\n\t\tcase <-c.Done():\n\t\t\treturn\n\t\tdefault:\n\t\t}\n\n\t\t// Begin the next round.\n\t\tplayerCyclesGauge.Inc()\n\t\tpp.logger.Infof(\"Starting player round #%d for %q...\", pp.roundCount, pp.sr.Path())\n\t\tpp.roundCount++\n\n\t\t// Reset our stream to its starting position.\n\t\tif err := pp.sr.Reset(); err != nil {\n\t\t\tpp.logger.Errorf(\"Failed to reset stream: %s\", err)\n\t\t}\n\n\t\tif err := pp.playRound(c); err != nil && errors.Cause(err) != context.Canceled {\n\t\t\tpp.logger.Warnf(\"Error during playback: %s\", err)\n\t\t\tplayerErrors.Inc()\n\t\t\treturn\n\t\t}\n\t}\n}",
"func (player *Player) PlayPause() {\n\tplayer.obj.Call(\"org.mpris.MediaPlayer2.Player.PlayPause\", 0)\n}",
"func Process(plyr Player) {\n\tlogPlayInfo(plyr)\n\tplyr.Play()\n\tplyr.Stop()\n}",
"func (asf *File) Play(animName string) {\n\tcur := asf.GetAnimation(animName)\n\tif cur == nil {\n\t\tlog.Fatal(`Error: Animation named \"` + animName + `\" not found in Aseprite file!`)\n\t}\n\tif asf.CurrentAnimation != cur {\n\t\tasf.CurrentAnimation = cur\n\t\tasf.finishedAnimation = false\n\t\tasf.CurrentFrame = asf.CurrentAnimation.Start\n\t\tif asf.CurrentAnimation.Direction == PlayBackward {\n\t\t\tasf.CurrentFrame = asf.CurrentAnimation.End\n\t\t}\n\t\tasf.pingpongedOnce = false\n\t}\n}",
"func (p *ComputerPlayer) Play(s *State) Action {\n\tfmt.Println(s)\n\tp.mark = s.Player()\n\treturn p.minimax(s)\n}",
"func player(ch chan say.VoicePart, counter int, debug bool) {\n\n\tfor i := 0; i < counter; i++ {\n\t\tvp := <-ch\n\t\tif debug {\n\t\t\tfmt.Printf(\"Index: %d\\nMessage: %s\\nFileName: %s\\n\",\n\t\t\t\tvp.Index, vp.Message, vp.FileName)\n\t\t\tfmt.Println(\"---------------------------\")\n\t\t}\n\t\ttmux := exec.Command(\"mpg123\", vp.FileName)\n\t\ttmux.Run()\n\t}\n}",
"func playSong(songBeat *model.SongBeat, player player.NotePlayer) {\n\n\tconst secondsInMinute float64 = 60.0\n\tconst songPlayTimeInSeconds = 20\n\n\tsecondsPerBeat := secondsInMinute / float64(songBeat.BeatsPerMinute)\n\tsecondsPerNote := secondsPerBeat / float64(songBeat.NotesPerBeat)\n\n\tnotesToPlay := getNotesToPlay(songBeat)\n\n\tnoteTicker := getNoteTicker(secondsPerNote)\n\tdone := make(chan bool)\n\n\tgo playNotes(done, noteTicker, player, notesToPlay)\n\n\ttime.Sleep(songPlayTimeInSeconds * time.Second)\n\tnoteTicker.Stop()\n\tdone <- true\n}",
"func (self Channel) Play(restart bool) error {\n\treturn boolToError(C.BASS_ChannelPlay(self.cint(), boolToInt(restart)))\n}",
"func (e *Engine) PlayWAV(chunk *mix.Chunk) {\n\tchunk.Play(-1, 0)\n}",
"func (intermediateBot *IntermediateBot) playNextMove() (bool, []string) {\n\t// TODO: implement the IntermediateBot play next functionality\n\treturn true, nil\n}",
"func (a *AudioLog) PlaySound(e pipanel.SoundEvent) error {\n\ta.log.Printf(\n\t\t\"## SOUND EVENT ##\\n\"+\n\t\t\t\"Sound: %s\\n\",\n\t\te.Sound)\n\n\treturn nil\n}",
"func (t *AudioPlayer) Start(a *app.App) {\n\n\tvar err error\n\tt.pc1, err = NewPlayerControl(a, \"bomb1.wav\")\n\tt.pc1.player.SetLooping(false)\n\tif err != nil {\n\t\ta.Log().Fatal(\"%s\", err)\n\t}\n\tt.pc1.SetPosition(40, 10)\n\ta.DemoPanel().Add(t.pc1)\n\n\tt.pc2, err = NewPlayerControl(a, \"Vivaldi1.wav\")\n\tif err != nil {\n\t\ta.Log().Fatal(\"%s\", err)\n\t}\n\tt.pc2.SetPosition(40, t.pc1.Position().Y+t.pc1.Height()+20)\n\ta.DemoPanel().Add(t.pc2)\n\n\tt.pc3, err = NewPlayerControl(a, \"bomb2.ogg\")\n\tt.pc3.player.SetLooping(false)\n\tif err != nil {\n\t\ta.Log().Fatal(\"%s\", err)\n\t}\n\tt.pc3.SetPosition(40, t.pc2.Position().Y+t.pc2.Height()+40)\n\ta.DemoPanel().Add(t.pc3)\n\n\tt.pc4, err = NewPlayerControl(a, \"Bach1.ogg\")\n\tif err != nil {\n\t\ta.Log().Fatal(\"%s\", err)\n\t}\n\tt.pc4.SetPosition(40, t.pc3.Position().Y+t.pc3.Height()+20)\n\ta.DemoPanel().Add(t.pc4)\n}",
"func (p *Player) Run() {\n\tfor {\n\t\ttrack, err := p.pcptr.Next()\n\t\tif err != nil {\n\t\t\tlog.Infof(\"Failed to Get Track: %s\", err)\n\t\t\t<-p.channels.CheckNext // Block until we have a next track\n\t\t\tcontinue\n\t\t}\n\t\tp.play(track) // Blocks\n\t\tp.pcptr.End(track) // Publish end event\n\t}\n}",
"func (p *Player) Play() bool {\n\tp.lock()\n\tdefer p.unlock()\n\t//++ TODO: move this logic to run() and use channels for communication\n\t// \t\t\tlike the other methods (SetVolume, etc)\n\n\tif p.vlcPlayer == nil {\n\t\treturn false\n\t}\n\n\tp.vlcPlayer.Play()\n\treturn true\n}",
"func PlayPause(w http.ResponseWriter, r *http.Request) {\n\tfmt.Println(\"Received Request: /MediaControls\")\n\taction := strings.TrimPrefix(r.URL.Path, \"/MediaControls/\")\n\tfmt.Println(\"Action:\", action)\n\n\tvar URL *url.URL\n\tURL, err := url.Parse(\"https://api.spotify.com\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tURL.Path += \"/v1/me/player/pause\"\n\n\tclient := &http.Client{}\n\n\treq, err := http.NewRequest(\"PUT\", URL.String(), nil)\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"Authorization\", \"Bearer \"+sAcsTok.AccessToken)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t_, err = client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n}",
"func (c *Client) PlayTrack(guildID string, track Track, options ...play.Option) error {\n\treturn c.Play(guildID, track.ID, options...)\n}",
"func (p *Playlist) Start() {\n\tgo p.playlistEventHandler()\n}",
"func (r *Radio) PlayQueue(ctx *system.Context, vc *discordgo.VoiceConnection) error {\n\n\t// Don't allow two running PlayQueue methods on the same radio.\n\tr.Lock()\n\tif r.running {\n\t\tr.Unlock()\n\t\treturn errors.New(\"Queue already playing\")\n\t}\n\tr.running = true\n\tr.Unlock()\n\n\tdefer func() {\n\t\tr.Lock()\n\t\tr.running = false\n\t\tr.Unlock()\n\t}()\n\n\tfor {\n\t\tdisp, err := r.Play(ctx.Ses, vc)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tr.Dispatcher = disp\n\n\t\t//----------------- Print information about the currently playing song ---------------- //\n\t\tsong, err := r.Queue.Song()\n\t\tif err == nil && !r.Silent {\n\t\t\tctx.ReplyEmbed(dream.NewEmbed().\n\t\t\t\tSetTitle(\"Now playing\").\n\t\t\t\tSetDescription(fmt.Sprintf(\"[%d]: %s\\nduration:\\t %ds\", r.Queue.Index, song.Markdown(), song.Duration)).\n\t\t\t\tSetFooter(\"added by \" + song.AddedBy).\n\t\t\t\tSetColor(system.StatusNotify).\n\t\t\t\tMessageEmbed)\n\t\t}\n\t\t//-------------------------------------------------------------------------------------//\n\n\t\tdone := make(chan bool)\n\t\tgo func() {\n\t\t\tdisp.Wait()\n\t\t\tdone <- true\n\t\t}()\n\n\t\tselect {\n\t\tcase ctrl := <-r.control:\n\t\t\tswitch ctrl {\n\t\t\tcase AudioStop:\n\t\t\t\tdisp.Stop()\n\t\t\t\treturn nil\n\t\t\tcase AudioContinue:\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tclose(done)\n\n\t\tcase <-done:\n\t\t\t// I only need to check for a closed voice connection after the done event\n\t\t\t// Is received because the dispatcher will end during a timeout error.\n\t\t\tif !vc.Ready {\n\t\t\t\treturn errors.New(\"Voice connection closed\")\n\t\t\t}\n\t\t\t// Load the next song if AutoPlay is enabled.\n\t\t\tif r.AutoPlay {\n\t\t\t\terr = r.Queue.Next()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\t// Otherwise, stop the queue.\n\t\t\t} else {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n}",
"func (c Client) Play() error {\n\terr := c.authenticateUser()\n\tif err != nil {\n\t\tfmt.Fprintf(c.Output, \"unexpected error authenticating user: %v\", err)\n\t\tos.Exit(1)\n\t}\n\n\treturn c.handleGameIO()\n}",
"func playSound(playCmd playCommand) ([][]byte, error) {\n\tval, ok := checkCache(playCmd.name)\n\tif ok {\n\t\treturn val, nil\n\t}\n\n\tvar opusData []byte\n\tif s3Persistence == \"true\" {\n\t\topusData = getSoundS3(playCmd.name)\n\t} else {\n\t\topusData = getSoundLocal(playCmd.name)\n\t}\n\n\tdecodedFrames := gobDecodeOpusFrames(opusData)\n\tputCache(playCmd.name, decodedFrames)\n\treturn decodedFrames, nil\n}",
"func (eng *Engine) Play(tc *TimeControl) (score int32, moves []Move) {\n\treturn eng.PlayMoves(tc, nil)\n}",
"func (s *Sound) PlayFromStart() {\n\ts.snd.Set(\"currentTime\", 0)\n\ts.snd.Call(\"play\")\n}",
"func (p *RandomPlayer) Play(s *State) Action {\n\tfmt.Println(s)\n\tactions := s.Actions()\n\ttime.Sleep(p.Delay * time.Second)\n\ti := rand.Intn(len(actions))\n\tfmt.Printf(\"%s picks %v randomly from %v\\n\", p.Name, actions[i], actions)\n\treturn actions[i]\n}",
"func Play(p1, p2 Player) {\n\tboard := NewBoard()\n\tvar currentPlayer Player\n\tround := 0\n\n\tfor {\n\t\tif round%2 == 0 {\n\t\t\tcurrentPlayer = p1\n\t\t} else {\n\t\t\tcurrentPlayer = p2\n\t\t}\n\n\t\tm := currentPlayer.GetMove(board)\n\t\tboard = board.NewMove(m)\n\t\tboard.Render()\n\t\tfmt.Println(\"\")\n\t\twinner := board.GetWinner()\n\n\t\tif winner != 0 {\n\t\t\tfmt.Printf(\"The winner is Player %d\\n\", winner)\n\t\t\tbreak\n\t\t}\n\t\tif board.IsFull() {\n\t\t\tfmt.Println(\"The game is a draw\")\n\t\t\tbreak\n\t\t}\n\t\tround++\n\t}\n}",
"func Play(left ChoiceID, right ChoiceID) (Result, error) {\n\tleftChoice, err := GetChoiceByID(left)\n\tif err != nil {\n\t\treturn nilResult, err\n\t}\n\n\trightChoice, err := GetChoiceByID(right)\n\tif err != nil {\n\t\treturn nilResult, err\n\t}\n\n\tif left == right {\n\t\treturn Result{leftChoice, rightChoice, leftChoice}, nil\n\t}\n\n\twinner := rightChoice\n\tdoesLeftBeatRight, ok := leftChoice.beats[rightChoice.Name]\n\tif ok && doesLeftBeatRight {\n\t\twinner = leftChoice\n\t}\n\n\treturn Result{leftChoice, rightChoice, winner}, nil\n}",
"func (player *musicPlayer) addPlayItem(playItem string) ([]string, error) {\n\t// is it file or directory\n\tfileInfo, err := os.Stat(playItem)\n\tif os.IsNotExist(err) {\n\t\t//try it for a playlist\n\t\tfileInfo, err = os.Stat(player.playlistsDir + playItem)\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil, errors.New(file_not_found_msg)\n\t\t}\n\t\tplayItem = player.playlistsDir + playItem\n\t}\n\n\titems := make([]string, 0)\n\n\tswitch mode := fileInfo.Mode(); {\n\tcase mode.IsDir():\n\t\td, err := os.Open(playItem)\n\t\tif err != nil {\n\t\t\treturn nil, errors.New(file_not_found_msg)\n\t\t}\n\t\tdefer d.Close()\n\t\tfiles, err := d.Readdir(-1)\n\t\tif err != nil {\n\t\t\treturn nil, errors.New(file_not_found_msg)\n\t\t}\n\t\tprefix := playItem\n\t\tif !strings.HasSuffix(playItem, \"/\") {\n\t\t\tprefix = prefix + \"/\"\n\t\t}\n\t\tfor _, file := range files {\n\t\t\tif file.Mode().IsRegular() {\n\t\t\t\tadded := player.addRegularFile(prefix + file.Name())\n\t\t\t\titems = append(items, added...)\n\t\t\t}\n\t\t}\n\tcase mode.IsRegular():\n\t\tadded := player.addRegularFile(playItem)\n\t\titems = append(items, added...)\n\n\t}\n\tif len(items) == 0 {\n\t\treturn nil, errors.New(format_not_supported_msg)\n\t}\n\treturn items, nil\n}",
"func (p *Player) Play(card Card, target Card) {\n\tcard.Play(p, target)\n\tp.Hand = p.Hand.Without(card)\n}",
"func (ac *ArtistCreate) SetPlays(i int64) *ArtistCreate {\n\tac.plays = &i\n\treturn ac\n}",
"func (p *Player) WillPlay() bool {\n\tif p.player == nil {\n\t\treturn false\n\t}\n\n\treturn C.libvlc_media_player_will_play(p.player) != 0\n}",
"func (player *musicPlayer) playSingleFile(filename string, trim float64, ch chan error) error {\n\t// Open the input file (with default parameters)\n\tin := sox.OpenRead(filename)\n\tif in == nil {\n\t\terr := errors.New(no_sox_in_msg)\n\t\tif ch != nil {\n\t\t\tch <- err\n\t\t}\n\t\treturn err\n\t}\n\tdefer in.Release()\n\n\t// Open the output device: Specify the output signal characteristics.\n\t// Since we are using only simple effects, they are the same as the\n\t// input file characteristics.\n\t// Using \"alsa\" or \"pulseaudio\" should work for most files on Linux.\n\t// \"coreaudio\" for OSX\n\t// On other systems, other devices have to be used.\n\tout := sox.OpenWrite(\"default\", in.Signal(), nil, \"alsa\")\n\tif out == nil {\n\t\tout = sox.OpenWrite(\"default\", in.Signal(), nil, \"pulseaudio\")\n\t\tif out == nil {\n\t\t\tout = sox.OpenWrite(\"default\", in.Signal(), nil, \"coreaudio\")\n\t\t\tif out == nil {\n\t\t\t\tout = sox.OpenWrite(\"default\", in.Signal(), nil, \"waveaudio\")\n\t\t\t\tif out == nil {\n\t\t\t\t\terr := errors.New(no_sox_out_msg)\n\t\t\t\t\tif ch != nil {\n\t\t\t\t\t\tch <- err\n\t\t\t\t\t}\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// It's observed that sox crashes at this step sometimes\n\tdefer out.Release()\n\n\tif ch != nil {\n\t\tch <- nil\n\t}\n\n\t// Create an effects chain: Some effects need to know about the\n\t// input or output encoding so we provide that information here.\n\tchain := sox.CreateEffectsChain(in.Encoding(), out.Encoding())\n\tdefer chain.Release()\n\n\t// The first effect in the effect chain must be something that can\n\t// source samples; in this case, we use the built-in handler that\n\t// inputs data from an audio file.\n\te := sox.CreateEffect(sox.FindEffect(\"input\"))\n\te.Options(in)\n\t// This becomes the first \"effect\" in the chain\n\tchain.Add(e, in.Signal(), in.Signal())\n\te.Release()\n\n\tif trim > 0 {\n\t\tinterm_signal := in.Signal().Copy()\n\n\t\te = sox.CreateEffect(sox.FindEffect(\"trim\"))\n\t\te.Options(strconv.FormatFloat(trim, 'f', 2, 64))\n\t\tchain.Add(e, interm_signal, in.Signal())\n\t\te.Release()\n\t}\n\n\t// The last effect in the effect chain must be something that only consumes\n\t// samples; in this case, we use the built-in handler that outputs data.\n\te = sox.CreateEffect(sox.FindEffect(\"output\"))\n\te.Options(out)\n\tchain.Add(e, in.Signal(), in.Signal())\n\te.Release()\n\n\tplayer.Lock()\n\tplayer.state.chain = chain\n\tplayer.state.status = playing\n\tplayer.state.startTime = time.Now()\n\tif trim > 0 {\n\t\tvar milis int64 = int64(-trim * 1000)\n\t\tplayer.state.startTime = player.state.startTime.Add(time.Duration(milis) * time.Millisecond)\n\t}\n\tplayer.Unlock()\n\n\t// Flow samples through the effects processing chain until EOF is reached.\n\t// Flow process is not locked as it must be possible to delete chain effects\n\t// while Flow is being executed\n\t// note: sox crashes at this step sometimes(rarely)\n\tchain.Flow()\n\n\tplayer.Lock()\n\tif player.state.status == playing {\n\t\tplayer.state.status = waiting\n\t}\n\tplayer.Unlock()\n\n\treturn nil\n}",
"func LoadPlaybookFile(location string, varsInput string) Playbook {\n\tvarInputMap := createVarMap(varsInput)\n\tdata, err := ioutil.ReadFile(location)\n\tif err != nil {\n\t\tfmt.Print(err)\n\t\tos.Exit(1)\n\t}\n\tplaybookTempl := Playbook{}\n\terr = yaml.Unmarshal([]byte(data), &playbookTempl)\n\tif err != nil {\n\t\tfmt.Print(err)\n\t\tos.Exit(1)\n\t}\n\tif len(playbookTempl.Inputs) > 0 {\n\t\tfor _, input := range playbookTempl.Inputs {\n\t\t\tif varVal, ok := varInputMap[input.Name]; ok {\n\t\t\t\tfmt.Println(fmt.Sprintf(\"Found input: %v - %v\", input.Name, varVal))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif len(input.Default) == 0 {\n\t\t\t\tvarSetByUser := GetStringFlag(\"\", \"\", fmt.Sprintf(\"Enter %v\", input.Name))\n\t\t\t\tvarInputMap[input.Name] = varSetByUser\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvarInputMap[input.Name] = input.Default\n\t\t}\n\t}\n\ttempl := template.New(\"playbook template\")\n\ttextTemplate, _ := templ.Parse(fmt.Sprintf(\"%s\", data))\n\tvar tpl bytes.Buffer\n\ttextTemplate.Execute(&tpl, varInputMap)\n\n\tplaybook := Playbook{}\n\terr = yaml.Unmarshal(tpl.Bytes(), &playbook)\n\tif err != nil {\n\t\tfmt.Print(err)\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(fmt.Sprintf(\"[Executing playbook: %v, file: %v]\", playbook.Name, location))\n\treturn playbook\n}",
"func TestLoadMp3(t *testing.T) {\n\t_, err := LoadFile(\"mp3/test.mp3\")\n\tassert.Nil(t, err)\n}",
"func playVideo(ctx context.Context, cs ash.ConnSource, videoFile, url string, unmutePlayer bool) (bool, error) {\n\tctx, st := timing.Start(ctx, \"play_video\")\n\tdefer st.End()\n\n\tconn, err := loadPage(ctx, cs, url)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdefer conn.Close()\n\tdefer conn.CloseTarget(ctx)\n\n\tobserver, err := conn.GetMediaPropertiesChangedObserver(ctx)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"failed to retrieve a media DevTools observer\")\n\t}\n\n\tif err := conn.Call(ctx, nil, \"playUntilEnd\", videoFile, unmutePlayer); err != nil {\n\t\treturn false, err\n\t}\n\n\tisPlatform, _, err := devtools.GetVideoDecoder(ctx, observer, url)\n\treturn isPlatform, err\n}",
"func (t *towers) play(n int) {\n\tt.moveN(n, \"A\", \"B\", \"C\")\n}",
"func (cli *CLI) PlayPoker() {\n\tcli.playerStore.RecordWin(\"Cleo\")\n}",
"func (player *musicPlayer) next() (string, error) {\n\tplayer.Lock()\n\tvar songToResume string\n\tif player.state.current < len(player.state.queue)-1 {\n\t\tif player.state.status == playing {\n\t\t\tplayer.stopFlow()\n\t\t}\n\t\tplayer.state.current += 1\n\t\tsongToResume = player.state.queue[player.state.current]\n\n\t} else {\n\t\tplayer.Unlock()\n\t\treturn songToResume, errors.New(cannot_next_msg)\n\t}\n\n\tplayer.Unlock()\n\tch := make(chan error)\n\tdefer close(ch)\n\tgo player.playQueue(0, ch)\n\terr := <-ch\n\n\treturn songToResume, err\n}",
"func ripSound(ripCmd ripCommand) error {\n\tvideoBuf, err := fetchVideoData(ripCmd.url)\n\tif err != nil {\n\t\treturn err\n\t}\n\topusFrames, err := convertToOpusFrames(videoBuf, ripCmd.start, ripCmd.duration)\n\tif err != nil {\n\t\treturn err\n\t}\n\tencodedFrames, err := gobEncodeOpusFrames(opusFrames)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif s3Persistence == \"true\" {\n\t\terr = putSoundS3(encodedFrames, ripCmd.name)\n\t} else {\n\t\terr = putSoundLocal(encodedFrames, ripCmd.name)\n\t}\n\treturn err\n}",
"func receive_mp3(server net.Conn, play chan bool, stop chan bool) {\n\tdefer server.Close()\n\tfor {\n\t\tselect {\n\t\tcase <-stop:\n\t\t\treturn\n\t\tcase <-play:\n\t\t\tdecoder, err := mp3.NewDecoder(server)\n\t\t\tif err != nil && err == io.EOF {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif err != nil && err != io.EOF {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tdefer decoder.Close()\n\t\t\tplayer, err := oto.NewPlayer(decoder.SampleRate(), 2, 2, 8192)\n\t\t\tif err != nil && err == io.EOF {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif err != nil && err != io.EOF {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tdefer player.Close()\n\n\t\t\tgo func() {\n\t\t\t\t_, _ = io.Copy(player, decoder)\n\t\t\t}()\n\t\t}\n\t}\n}",
"func mp3File(t Tags) string {\n\tfqp := path.Join(Homedir(), \"Music\", \"audio\", hierarchy(t)) + \".mp3\"\n\tlog.Printf(\"Using mp3 file %s\\n\", fqp)\n\treturn fqp\n}",
"func (r *Recorder) PlayPrompt(call *Call) bool {\n\tprompt, exists := r.Config(\"prompt\")\n\tif !exists {\n\t\tr.logger.Debugf(\"Recorder [%s] has no prompt defined\", r.Name())\n\t\treturn false\n\t}\n\tr.status = stPrompt\n\tr.PlayWave(prompt.(string), call, map[string]string{})\n\treturn true\n}",
"func (c *Client) playRaw(bytes []byte) {\n\t// Decode and adjust audio\n\tvolume := MaxVolume - c.Volume()\n\tsamples := make([]int16, len(bytes)/2)\n\tfor i := range samples {\n\t\tsamples[i] = int16(binary.LittleEndian.Uint16(bytes[i*2:i*2+2])) >> volume\n\t}\n\n\t// Play the audio\n\tc.Mumble.SendAudio(samples)\n}"
] | [
"0.707698",
"0.69615823",
"0.68848103",
"0.6590502",
"0.6539397",
"0.6478501",
"0.6460065",
"0.6454496",
"0.6398643",
"0.6380446",
"0.632894",
"0.6316868",
"0.6291548",
"0.62592703",
"0.6197194",
"0.6156544",
"0.6078066",
"0.6060008",
"0.6050678",
"0.60488045",
"0.6047431",
"0.60454684",
"0.6043469",
"0.6004177",
"0.59900916",
"0.5985822",
"0.59555626",
"0.5918126",
"0.59143454",
"0.59009594",
"0.58935183",
"0.5875927",
"0.58473593",
"0.5826591",
"0.58142525",
"0.5814146",
"0.58111405",
"0.57811964",
"0.57678807",
"0.5765335",
"0.5763174",
"0.5751334",
"0.5649395",
"0.5637814",
"0.5625063",
"0.56098676",
"0.5589775",
"0.55679893",
"0.5563805",
"0.5559152",
"0.55566454",
"0.5488808",
"0.546528",
"0.54364055",
"0.54288304",
"0.53891414",
"0.53684497",
"0.53613055",
"0.5346287",
"0.5332986",
"0.53271544",
"0.53143203",
"0.5303018",
"0.52880424",
"0.528525",
"0.52673835",
"0.52312595",
"0.52213436",
"0.5217166",
"0.52099526",
"0.5206596",
"0.52064764",
"0.52018917",
"0.51720834",
"0.5168884",
"0.51672506",
"0.51451224",
"0.513855",
"0.5136523",
"0.5123733",
"0.51012444",
"0.5067858",
"0.5063665",
"0.50581354",
"0.5053316",
"0.50408",
"0.50206417",
"0.50188965",
"0.49490932",
"0.49290377",
"0.48974827",
"0.4897151",
"0.4894875",
"0.48901725",
"0.48847282",
"0.48641318",
"0.48451522",
"0.48381934",
"0.48345912",
"0.48220006"
] | 0.6251563 | 14 |